If you change the main page on MediaWiki:Mainpage to a link with a hash (ie: Other Page#Section), the "Main page" link in the sidebar is correctly implemented (the link goes to Other Page#Section), but the logo drops the unexpectedly drops the hash (the link goes to just Other Page).
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Consistently preserve anchors in the title specified in 'mainpage' message | mediawiki/core | master | +1 -1 |
Event Timeline
I do not consider this a bug as the name of an anchor on a page is not the same as the name of a page?
If you change Mediawiki:Mainpage to something, would you not expect the two places that use that value (the "Main page" text link and the logo) to both use that value consistently? The text link goes to the exact destination that I specified where as the image link only goes part of the way.
No, as for sidebar items it feels more usual to link to some anchors. I would not expect that from a top-level logo link... :)
For anyone else who might run into this issue and get annoyed at this bug, I mean "undocumented feature", and want to make your link to go to where you set it, here's a "temporary" hack to fix this:
$wgHooks['SkinTemplateOutputPageBeforeExec'][] = 'lfChangeMainPageURL'; function lfChangeMainPageURL( $sk, &$tpl ) { $tpl->data['nav_urls']['mainpage']['href'] = '/where/you/want/your/link/to#go'; return true;}
Change 381134 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] Consistently preserve anchors in the title specified in 'mainpage' message
Change 381134 merged by jenkins-bot:
[mediawiki/core@master] Consistently preserve anchors in the title specified in 'mainpage' message