From 8325a97d7ce0ccc06fa4843c7fad7fbdd22b3ddc Mon Sep 17 00:00:00 2001 From: aude Date: Wed, 8 May 2013 06:31:55 +0000 Subject: [PATCH] Add setting wgLogAutopatrol to toggle logging of autopatrol actions 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 | 2 ++ includes/DefaultSettings.php | 3 +++ includes/logging/PatrolLog.php | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index ded2cee7fa..1591fa96b0 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -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. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 1b56547dc9..b86de8c097 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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; diff --git a/includes/logging/PatrolLog.php b/includes/logging/PatrolLog.php index 911fffc0e6..bb76d5a959 100644 --- a/includes/logging/PatrolLog.php +++ b/includes/logging/PatrolLog.php @@ -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 ) ) { -- 2.20.1