Last modified: 2011-07-05 22:10:43 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 T31723, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29723 - mw.util.wikiGetlink() should default to wgPageName
mw.util.wikiGetlink() should default to wgPageName
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Krinkle
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-05 21:42 UTC by Helder
Modified: 2011-07-05 22:10 UTC (History)
2 users (show)

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


Attachments
Example (501 bytes, patch)
2011-07-05 21:42 UTC, Helder
Details

Description Helder 2011-07-05 21:42:25 UTC
Created attachment 8744 [details]
Example

Currently, if a user calls mw.util.wikiGetlink()[1] on [[Example]] it will be returned
"http://en.wikipedia.org/wiki/undefined"
which is not very useful.

Considering that it is common[2] to have constructs like
 mw.util.wikiGetlink( mw.config.get( 'wgPageName' ) ) + '?foo=bar&baz=meh'
I propose the addition of wgPageName as a default value for the "str" parameter of this function, so that users coudl then use mw.util.wikiGetlink() on [[Example]] to get
"http://en.wikipedia.org/wiki/Example"

[1] http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/mediawiki/mediawiki.util.js?view=markup#l134
[2] See e.g.: [[MediaWiki:Gadget-purgetab.js]], [[pt:MediaWiki:Common.js]], [[s:MediaWiki:Common.js]], etc...
Comment 1 Krinkle 2011-07-05 22:10:43 UTC
Makes perfect sense.

Solution implemented in r91500.

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


Navigation
Links