Esanders has uploaded a new change for review.

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


Change subject: Remove preference prefix string
......................................................................

Remove preference prefix string

Preferences should belong to the extensions they control as
they don't necessarily want to be dependent on the BetaFeatures
extensions to control them.

Change-Id: Id510b2e874920ea222f7717accca2c5956a4e9c3
---
M BetaFeaturesHooks.php
1 file changed, 3 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BetaFeatures 
refs/changes/28/81528/1

diff --git a/BetaFeaturesHooks.php b/BetaFeaturesHooks.php
index 1886888..55f45b5 100644
--- a/BetaFeaturesHooks.php
+++ b/BetaFeaturesHooks.php
@@ -83,17 +83,15 @@
                        }
 
                        if ( $complete ) {
-                               $prefname = 'beta-feature-' . $key;
+                               $prefs[$key] = $opt;
 
-                               $prefs[$prefname] = $opt;
-
-                               $currentValue = $user->getOption( $prefname );
+                               $currentValue = $user->getOption( $key );
                                if ( $currentValue !== 
HTMLFeatureField::OPTION_ENABLED &&
                                                $currentValue !== 
HTMLFeatureField::OPTION_DISABLED &&
                                                $user->getOption( 
'beta-feature-auto-enroll' ) === HTMLFeatureField::OPTION_ENABLED ) {
                                        // We haven't seen this before, and the 
user has auto-enroll enabled!
                                        // Set the option to true.
-                                       $user->setOption( $prefname, 
HTMLFeatureField::OPTION_ENABLED );
+                                       $user->setOption( $key, 
HTMLFeatureField::OPTION_ENABLED );
                                }
                        }
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/81528
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id510b2e874920ea222f7717accca2c5956a4e9c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BetaFeatures
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to