Add all gadgets to DefaultUserOptions

Without the default the preference is never deleted from the database,
even it was disabled by the user.

Bug: T291748
Change-Id: I1010e260fda118cbea83ad39e33055e403e37630
This commit is contained in:
Umherirrender 2021-09-29 01:41:55 +02:00
parent 0007744ee6
commit d175e964db

View file

@ -75,9 +75,7 @@ class GadgetHooks {
*/
foreach ( $gadgets as $thisSection ) {
foreach ( $thisSection as $gadgetId => $gadget ) {
if ( $gadget->isOnByDefault() ) {
$defaultOptions['gadget-' . $gadgetId] = 1;
}
$defaultOptions['gadget-' . $gadgetId] = $gadget->isOnByDefault() ? 1 : 0;
}
}
}