Page MenuHomePhabricator

Set default user options for gadgets that are enabled by default
Closed, ResolvedPublic

Description

There currently is a bug in 1.18 branch of Gadgets (and trunk as well) that gadgets that are enabled by default cannot be disabled.

The reason is simple. HTMLForm is given a set of names that are should have ticked checkboxes. Gadgets extension gives the names here of gadgets that are either "user-enabled" or "default-enabled and not user-disabled". That's OK to be mixed when outputting checkboxes. But when processing the form submission, HTMLForm simply has to know the defaults separate from user-enabled, otherwise when it's checking wgDefaultUserOptions and finds no default value, it will assume that the user has set this value and wants to keep it.

However, this is currently impossible to fix because wgDefaultUserOptions can only be set globally, and not until after the gadgets have been parsed will it know which are default on.

As soon as bug 30940 has been done, Gadgets needs to make use of it.


Version: unspecified
Severity: major

Details

Reference
bz30941

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:48 PM
bzimport set Reference to bz30941.

I confirmed that bug 30942 is caused by this.

Setting the following in LocalSettings.php fixed bug 30942 for gadget 'X':

$wgDefaultUserOptions['gadget-A'] = 1;

Done in r97366.

Keeping bug open until it's been done in trunk as well.