Reading http://meta.wikimedia.org/wiki/Help:System_messages, one wonders if one can set messages in LocalSettings.php instead of editing MediaWiki:Copyrightpage. However I just get 'Call to a member function addMessages() on a non-object'.
jidanni@jidanni.org schrieb:
Reading http://meta.wikimedia.org/wiki/Help:System_messages, one wonders if one can set messages in LocalSettings.php instead of editing MediaWiki:Copyrightpage. However I just get 'Call to a member function addMessages() on a non-object'.
That's because the object isn't there yet when LocalSettings.php is read. The config is read *before* initialization, of course. You can register a function in wgExtensionFunctions, that will get called after setup. you can inject messages there. But editing the system message on the wiki seems the much nicer solution, don't you think?
-- daniel
Daniel Kinzler schreef:
jidanni@jidanni.org schrieb:
Reading http://meta.wikimedia.org/wiki/Help:System_messages, one wonders if one can set messages in LocalSettings.php instead of editing MediaWiki:Copyrightpage. However I just get 'Call to a member function addMessages() on a non-object'.
That's because the object isn't there yet when LocalSettings.php is read. The config is read *before* initialization, of course. You can register a function in wgExtensionFunctions, that will get called after setup. you can inject messages there. But editing the system message on the wiki seems the much nicer solution, don't you think?
Yeah, why would you want that? You can protect MediaWiki: pages too (although editing them is already restricted to sysops by default), so you could protect this particular page so that only you can edit it (add a right to $wgRestrictionLevels and make sure only you have it).
Roan Kattouw (Catrope)
Roan Kattouw wrote:
Yeah, why would you want that? You can protect MediaWiki: pages too (although editing them is already restricted to sysops by default), so you could protect this particular page so that only you can edit it (add a right to $wgRestrictionLevels and make sure only you have it).
Presumably he's not using memcached, and would like to avoid the extra database hits. For such uses, it'd be kind of nice to have a simple way of customizing system messages via LocalSettings.php.
Ilmari Karonen schrieb:
Roan Kattouw wrote:
Yeah, why would you want that? You can protect MediaWiki: pages too (although editing them is already restricted to sysops by default), so you could protect this particular page so that only you can edit it (add a right to $wgRestrictionLevels and make sure only you have it).
Presumably he's not using memcached, and would like to avoid the extra database hits. For such uses, it'd be kind of nice to have a simple way of customizing system messages via LocalSettings.php.
That db will be hit anyway, it needs to see if the message was overridden by editing the wiki page.
-- daniel
On Wed, Mar 18, 2009 at 6:22 PM, Daniel Kinzler daniel@brightbyte.de wrote:
That db will be hit anyway, it needs to see if the message was overridden by editing the wiki page.
Not if you disable $wgUseDatabaseMessages.
wikitech-l@lists.wikimedia.org