Ladsgroup has uploaded a new change for review.

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

Change subject: Support wikis when $wgUseRCPatrol = false
......................................................................

Support wikis when $wgUseRCPatrol = false

In this case "r" flag sticks there forever

Bug: T130150
Change-Id: I1883f4c82a4acaa35f01caed9f622bee7ce2bc12
---
M includes/Hooks.php
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES 
refs/changes/51/278751/1

diff --git a/includes/Hooks.php b/includes/Hooks.php
index 9cea658..60a5ced 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -97,6 +97,7 @@
                array &$query_options, array &$join_conds, FormOptions $opts
        ) {
                global $wgUser;
+               global $wgUseRCPatrol;
                if ( self::oresEnabled( $wgUser ) === false ) {
                        return true;
                }
@@ -128,7 +129,9 @@
                        $conds['oresc_is_predicted'] = 1;
                        $conds[] = 'oresc_probability > '
                                . $dbr->addQuotes( $threshold );
-                       $conds['rc_patrolled'] = 0;
+                       if ( $wgUseRCPatrol ) {
+                               $conds['rc_patrolled'] = 0;
+                       }
                }
 
                return true;
@@ -225,6 +228,7 @@
         */
        protected static function getScoreRecentChangesList( $rcObj ) {
 
+               global $wgUseRCPatrol;
                $threshold = $rcObj->getAttribute( 'ores_threshold' );
                if ( $threshold === null ) {
                        // FIXME: What is the impact of this
@@ -236,7 +240,7 @@
                $score = $rcObj->getAttribute( 'oresc_probability' );
                $patrolled = $rcObj->getAttribute( 'rc_patrolled' );
 
-               return $score && $score >= $threshold && !$patrolled;
+               return $score && $score >= $threshold && ( !$patrolled || 
!$wgUseRCPatrol );
        }
 
        /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1883f4c82a4acaa35f01caed9f622bee7ce2bc12
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

Reply via email to