Last modified: 2011-09-28 22:10:04 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 T33233, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31233 - Make OutputPage's mw.config array extendable internally instead of hard coded
Make OutputPage's mw.config array extendable internally instead of hard coded
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.18.x
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Krinkle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-28 21:27 UTC by Krinkle
Modified: 2011-09-28 22:10 UTC (History)
3 users (show)

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


Attachments

Description Krinkle 2011-09-28 21:27:12 UTC
MediaWiki has two queues for mw.config variables. A site-wide set defined and outputted by ResourceLoader's startup module (i.e. wgSiteName, wgLoadScript, wgScriptPath, etc.). And one that is page specific (skin, wgPageName, wgUserName etc.).

The latter is hardcoded in OutputPage->getJSVars. Although it can be extended by extensions through the MakeGlobalVariablesScript, it's still annoying to have to define these variables in the hooks file instead of in, for example, the SpecialPage class itself. Another problem is access to the current context's Title object. I added $out to the hook in r96015 (which has getTitle()) but that only makes it a little but nicer.

the hard coded array should be an object member that can be extended via an add*() method. That way a SpecialPage (or for example ProtectionForm  - poke bug 31230), can simply do $out->addThingy('wgFoo, 'bar')
Comment 1 Krinkle 2011-09-28 22:10:04 UTC
Fixed in r98374.

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


Navigation
Links