Last modified: 2011-04-30 01:21:00 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T26343, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 24343 - localurl discards section id
localurl discards section id
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.15.x
All All
: Low minor with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-12 04:41 UTC by Jim Tittsler
Modified: 2011-04-30 01:21 UTC (History)
3 users (show)

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


Attachments

Description Jim Tittsler 2010-07-12 04:41:26 UTC
{{localurl:User:Bob#section}} discards the '#section' part in building the local URL.

That seems inconsistent with {{fullurl:User:Bob#section}} which keeps it.
Comment 1 Antoine "hashar" Musso (WMF) 2010-09-29 19:52:38 UTC
#section is known as a fragment.
Title::getLocalURL() does not return the fragment. To get it, one should use Title::getLinkUrl().

Committed in trunk as r73976
Comment 2 MZMcBride 2010-09-29 21:25:33 UTC
(In reply to comment #1)
> #section is known as a fragment.
> Title::getLocalURL() does not return the fragment. To get it, one should use
> Title::getLinkUrl().
> 
> Committed in trunk as r73976

You added a new magic word instead of fixing the current one? I don't understand.
Comment 3 Platonides 2010-09-29 21:38:48 UTC
Neither do I :P
Comment 4 MZMcBride 2010-09-29 22:24:36 UTC
Re-opening this for now.
Comment 5 Antoine "hashar" Musso (WMF) 2010-09-30 21:37:32 UTC
To me getLocalURL() and getLinkUrl() are two different functions and deserve differents magic word.
Comment 6 Platonides 2010-10-02 20:23:21 UTC
But what's the usecase for having a magic word which strips the fragment?
Comment 7 Antoine "hashar" Musso (WMF) 2010-10-05 06:28:12 UTC
Since Title has two functions, I though we could have two magic words as well.

One possibility was to map {{localurl:}} with Title::getLinkUrl()  instead of Title::getLocalURL(), but that looks weird and inconsistent.
Comment 8 MZMcBride 2010-10-05 06:58:47 UTC
(In reply to comment #7)
> Since Title has two functions, I though we could have two magic words as well.
> 
> One possibility was to map {{localurl:}} with Title::getLinkUrl()  instead of
> Title::getLocalURL(), but that looks weird and inconsistent.

I think you should re-read the opening post. :-)

"{{localurl:User:Bob#section}}" returns "/wiki/User:Bob". This is wrong. This is the bug. Instead, "{{localurl:User:Bob#section}}" should return "/wiki/User:Bob#section", just like {{fullurl:}} does currently. (And "{{localurl:User:Bob#section|action=edit}}" should return "/w/index.php?title=User:Bob&action=edit#section".)

I can't see any reason {{localurl:}} would intentionally strip the section anchor.

If there are use-cases for other magic words, I think they should be the topic of other bugs. This one is about {{localurl:}} stripping the section anchor needlessly and unexpectedly.
Comment 9 Antoine "hashar" Musso (WMF) 2010-10-23 17:05:38 UTC
patch r73976 reverted with r75250

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


Navigation
Links