jenkins-bot has submitted this change and it was merged.

Change subject: Fix one bug and an improvement
......................................................................


Fix one bug and an improvement

- Fix bug in loading threshold
- Use proper default user option

Change-Id: I6109cc6380b498ed59869268e23d0447129b67dc
---
M extension.json
M includes/Hooks.php
2 files changed, 5 insertions(+), 6 deletions(-)

Approvals:
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index c393caf..74a8f47 100644
--- a/extension.json
+++ b/extension.json
@@ -76,5 +76,8 @@
                        }
                }
        },
+       "DefaultUserOptions": {
+               "oresDamagingPref": "hard" 
+       },
        "manifest_version": 1
 }
diff --git a/includes/Hooks.php b/includes/Hooks.php
index c50d577..9fba12e 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -180,7 +180,7 @@
         */
        protected static function getScoreRecentChangesList( $rcObj ) {
 
-               $score = $rcObj->getAttribute( 'ores_threshold' );
+               $threshold = $rcObj->getAttribute( 'ores_threshold' );
                if ( $threshold === null ) {
                        $logger = LoggerFactory::getInstance( 'ORES' );
                        $logger->debug( 'WARNING: Running low perofrmance 
actions, ' .
@@ -201,14 +201,10 @@
         */
        protected static function getThreshold() {
                global $wgOresDamagingThresholds;
-               global $wgOresDamagingDefault;
                global $wgUser;
 
                $pref = $wgUser->getOption( 'oresDamagingPref' );
-               // User is not logged in, returning default
-               if ( $wgOresDamagingThresholds[$pref] === null ) {
-                       return 
$wgOresDamagingThresholds[$wgOresDamagingDefault];
-               }
+
                return $wgOresDamagingThresholds[$pref];
        }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6109cc6380b498ed59869268e23d0447129b67dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to