Last modified: 2012-06-06 18:38:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 32085 - Keep given anchor on Special:PermanentLink
Keep given anchor on Special:PermanentLink
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.18.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-31 17:44 UTC by Umherirrender
Modified: 2012-06-06 18:38 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Umherirrender 2011-10-31 17:44:14 UTC
Please keep the given anchor on Special:PermanentLink.

The wikilink [[Special:PermanentLink/1#test]] gives
/w/index.php?oldid=1
better is
/w/index.php?oldid=1#test

Thanks.
Comment 1 Brion Vibber 2011-10-31 18:01:48 UTC
Seems to work for me...

When I follow <https://en.wikipedia.org/wiki/Special:PermanentLink/1#test> I end up at <https://en.wikipedia.org/w/index.php?oldid=1#test>

Same seems to work on a local wiki install, both trunk and 1.18.

Tested in Firefox 7.0.1.
Comment 2 Umherirrender 2011-10-31 18:24:59 UTC
I am using IE8, but works in Firefox 4.0 on my machine.
Comment 3 Brion Vibber 2011-10-31 19:18:38 UTC
I can confirm that IE8 on WinXP behaves as described above (drops the #test).

Looking at the code for Special:PermanentLink it looks like the replacement of the #test is actually something that Firefox is doing explicitly in the browser side...

Hash fragments are not actually sent to the server, so the server-side processing has no way to know if there is one or not. It just empties out the existing parameters and replaces them with an 'oldid' param set to whatever the subpage parameter was.

So when you go to <http://en.wikipedia.org/wiki/Special:Permalink/1#test>

MediaWiki sees that you went to "/wiki/Special:Permalink/1". It sends you back to "/wiki/index.php?oldid=1".

Your browser may then be smart enough to say "maybe you wanted to keep that #test on the redirected URL?" and add it on... but MediaWiki never saw it in the first place.

Only way to fix this as a general case I can think of would be to redo it to run the redirect through JavaScript instead of as an HTTP redirect; client-side JavaScript could detect the fragment on document.location and preserve it when navigating over to the target page.
Comment 4 Daniel Friesen 2011-10-31 19:24:05 UTC
(In reply to comment #3)
> Only way to fix this as a general case I can think of would be to redo it to
> run the redirect through JavaScript instead of as an HTTP redirect; client-side
> JavaScript could detect the fragment on document.location and preserve it when
> navigating over to the target page.

*twitch* please no, not JavaScript...

A media: style special case where the parser sees Special:Permalink and a # and gives the /index.php url directly would be a tolerable hack if the alternative is turning a HTTP redirect into a page that uses JS.
Comment 5 Umherirrender 2012-06-06 18:38:06 UTC
The browser (IE8) is not showing the anchor, but jumping to the section, so all is good.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links