Ladsgroup has uploaded a new change for review.
https://gerrit.wikimedia.org/r/266649
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES
refs/changes/49/266649/1
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: newchange
Gerrit-Change-Id: I6109cc6380b498ed59869268e23d0447129b67dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits