Last modified: 2013-11-12 16:25:48 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 T52671, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 50671 - Apply default settings after setup is complete.
Apply default settings after setup is complete.
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Wikidata bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-03 15:15 UTC by Daniel Kinzler
Modified: 2013-11-12 16:25 UTC (History)
3 users (show)

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


Attachments

Description Daniel Kinzler 2013-07-03 15:15:03 UTC
Currently, we initialize our settings array with the defaults, and then allow them to be overwritten in LocalSettings.php. This means however that the defaults must be fixed, and can not depend on global mediawiki settings, because these are not guaranteed to be defined yet (one notable example is $wgServer - it's only initialized after LocalSettings.php is complete, in Setup.php).

To avoid this issues, we should just provide empty settings arrays, and apply default values later for all keys that have not been explicitly set in LocalSettings. "Later" here probably means when the SettingsArray is initialized by merging the different settings arrays.

This would also allow defaults to depend on whether or not some other extension is loaded - e.g. have different defaults for the client if the repo is active locally.
Comment 1 Daniel Kinzler 2013-07-03 15:16:59 UTC
The downside of this is that we can't have settings that *add* to default values, or replace parts of them. One notable example is the list of available data types: we would want to allow this list to be *expanded* in LocalSettings.php.

Perhaps the solution is to allow *some* defaults to be evaluated late - perhaps by setting them to a callback, or by registering a callback in a separate array.
Comment 2 Daniel Kinzler 2013-10-29 16:56:02 UTC
We now allow defaults to be specified using callbacks. A bit hackish, but powerful and functional.

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


Navigation
Links