SID-01848: RedirectPlugin does not properly handle anchors
| Status: |
Answered |
TWiki version: |
5.0.2 |
Perl version: |
|
| Category: |
RedirectPlugin |
Server OS: |
|
Last update: |
10 years ago |
A redirect from redirecting page that points to an anchor in the target topic does not go to the anchor.
--
Joshua Tharp - 2013-12-31
Discussion and Answer
The
RedirectPluginDev topic had a clue on this issue.
A redirect in the topic IRedirectToSomeWhere like:
%REDIRECT{"SomeWhere#SomeAnchor"}%
Forms a URL like:
{omitted}/SomeWhere#SomeAnchor?redirectedfrom=IRedirectToSomeWhere
However the anchor should be the last thing like this:
{omitted}/SomeWhere?redirectedfrom=IRedirectToSomeWhere#SomeAnchor
Plugin version 26175 lines 136-138:
TWiki::Func::redirectCgiQuery( $query,
TWiki::Func::getViewUrl( $newWeb, $newTopic ) . $anchor
. $q );
Changed to:
TWiki::Func::redirectCgiQuery( $query,
TWiki::Func::getViewUrl( $newWeb, $newTopic ) . $q
. $anchor );
--
Joshua Tharp - 2013-12-31
The above solution depends on
SID-01846 to function properly.
--
Joshua Tharp - 2013-12-31
Thank you Joshua! I finally updated the
RedirectPlugin with your fix.
--
Peter Thoeny - 2015-12-03
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.