From d175e964dba8cebb413bfebc8b753729a0d02872 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Wed, 29 Sep 2021 01:41:55 +0200 Subject: [PATCH] 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 --- includes/GadgetHooks.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/includes/GadgetHooks.php b/includes/GadgetHooks.php index 830e06a4..e093f605 100644 --- a/includes/GadgetHooks.php +++ b/includes/GadgetHooks.php @@ -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; } } }