Add setting wgLogAutopatrol to toggle logging of autopatrol actions
authoraude <aude.wiki@gmail.com>
Wed, 8 May 2013 06:31:55 +0000 (06:31 +0000)
committeraude <aude.wiki@gmail.com>
Thu, 30 May 2013 13:31:37 +0000 (13:31 +0000)
Per bug 47415, this is needed for Wikidata and could be useful for
other wikis, as well.

Bug: 47415
Change-Id: Ic999454d001c38dea08746d1e8184f0163cb7330

RELEASE-NOTES-1.22
includes/DefaultSettings.php
includes/logging/PatrolLog.php

index ded2cee..1591fa9 100644 (file)
@@ -27,6 +27,8 @@ production.
 * $wgJsMimeType is no longer used by core. Most usage has been removed since
   HTML output is now exclusively HTML5.
 * $wgDBOracleDRCP added. True enables persistent connection with DRCP on Oracle.
+* $wgLogAutopatrol added to allow disabling logging of autopatrol edits in the logging table.
+  default for $wgLogAutopatrol is true.
 
 === New features in 1.22 ===
 * (bug 44525) mediawiki.jqueryMsg can now parse (whitelisted) HTML elements and attributes.
index 1b56547..b86de8c 100644 (file)
@@ -5147,6 +5147,9 @@ $wgUseRCPatrol = true;
 /** Use new page patrolling to check new pages on Special:Newpages */
 $wgUseNPPatrol = true;
 
+/** Log autopatrol actions to the log table */
+$wgLogAutopatrol = true;
+
 /** Provide syndication feeds (RSS, Atom) for, e.g., Recentchanges, Newpages */
 $wgFeed = true;
 
index 911fffc..bb76d5a 100644 (file)
@@ -38,6 +38,13 @@ class PatrolLog {
         * @return bool
         */
        public static function record( $rc, $auto = false, User $user = null ) {
+               global $wgLogAutopatrol;
+
+               // do not log autopatrolled edits if setting disables it
+               if ( $auto && !$wgLogAutopatrol ) {
+                       return false;
+               }
+
                if ( !$rc instanceof RecentChange ) {
                        $rc = RecentChange::newFromId( $rc );
                        if ( !is_object( $rc ) ) {