Page MenuHomePhabricator

Echo's default user options overrides prevent overrides in LocalSettings.php
Open, Needs TriagePublic

Description

I'm splitting this from T296270: Cross-wiki notifications don't appear to be working as the follow-up discussion.

The default of true seems to be set in wmf config, not extension config.

Maybe the order of loading config is now a problem, when the hook is running after the settings is set and overrides it.

https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/8b9e94cd0955d66344d706f4450e66f04683c86a/wmf-config/CommonSettings.php#3228

I think so, the hook is overwriting the config...which would mean it's impossible to set defaults for any of the other settings?

Also in Pre-UserOptionsLookup code [1] the hook overrides the defaults from LocalSettings.php.
It seems that options from the hook could not get values from the config. But the global is for that purpose.

It is not possible to change the order, because echo also looks for default of core settings, which should reflect changes in LocalSettings.php as well ... (but that is part of my patch set and could be removed as well).

The options with a fix name could be moved to extension.json, but the variable named options are not ready for overrides (but that is not new to echo extension).
Fixing all hooks to check if the option is already set is also much work and could be broken in future again.

[1] https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/refs/heads/REL1_34/includes/user/User.php#1703
[2] https://www.mediawiki.org/wiki/Manual:$wgDefaultUserOptions

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 740940 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] Move core's $wgDefaultUserOptions into class DefaultOptionsLookup

https://gerrit.wikimedia.org/r/740940

kostajh added a subscriber: kostajh.

Tagging Platform Engineering as the proposed patch touches code most recently updated by members of that team.