From eb1caed560cae1093deb6f44385684674890cbb5 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Sat, 14 Oct 2017 03:20:10 +0000 Subject: [PATCH] No longer special case 'patrol' in $wgFilterLogTypes Previously, if you did not have the right to patrol/view patrolmarks, you were not allowed to filter Special:Log to remove autopatrol entries. Now if wikiadmins want to disable the filtering, they have to directly change the config value. This was stupid because: * Users without patrol rights are just as likely to not care about autopatrol spam as users with the priv. * Sometimes wikiadmins want to hide old patrol log entries even after they disabled the patrol feature. It should be noted there have been two previously attempts at fixing this issue that didn't go anywhere: * I9de17fc197a06402a4999a9fb792b86657641f76 * I88448ca0f09069943fd514a5b8213dfdafa57299 Bug: T44246 Change-Id: I590db72c169f3a9ad96c710f088923419d40e48d --- RELEASE-NOTES-1.31 | 2 ++ includes/DefaultSettings.php | 12 ++++++++++++ includes/logging/LogPager.php | 12 +++++------- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index a4ce4810ac..b5ec0d6b2b 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -13,6 +13,8 @@ production. temporary variable during the migration period, deprecated since 1.29. * $wgLogoHD has been updated to support svg images and uses $wgLogo where possible for fallback images such as png. +* (T44246) $wgFilterLogTypes will no longer ignore 'patrol' when user does + not have the right to mark things patrolled. * … === New features in 1.31 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 040f1ce7bf..497b86d074 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -6804,6 +6804,10 @@ $wgRCWatchCategoryMembership = false; /** * Use RC Patrolling to check for vandalism (from recent changes and watchlists) * New pages and new files are included. + * + * @note If you disable all patrolling features, you probably also want to + * remove 'patrol' from $wgFilterLogTypes so a show/hide link isn't shown on + * Special:Log. */ $wgUseRCPatrol = true; @@ -6835,12 +6839,20 @@ $wgStructuredChangeFiltersLiveUpdatePollingRate = 3; /** * Use new page patrolling to check new pages on Special:Newpages + * + * @note If you disable all patrolling features, you probably also want to + * remove 'patrol' from $wgFilterLogTypes so a show/hide link isn't shown on + * Special:Log. */ $wgUseNPPatrol = true; /** * Use file patrolling to check new files on Special:Newfiles * + * @note If you disable all patrolling features, you probably also want to + * remove 'patrol' from $wgFilterLogTypes so a show/hide link isn't shown on + * Special:Log. + * * @since 1.27 */ $wgUseFilePatrol = true; diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php index f79fcfa61c..df432e1517 100644 --- a/includes/logging/LogPager.php +++ b/includes/logging/LogPager.php @@ -97,13 +97,11 @@ class LogPager extends ReverseChronologicalPager { return $filters; } foreach ( $wgFilterLogTypes as $type => $default ) { - // Avoid silly filtering - if ( $type !== 'patrol' || $this->getUser()->useNPPatrol() ) { - $hide = $this->getRequest()->getInt( "hide_{$type}_log", $default ); - $filters[$type] = $hide; - if ( $hide ) { - $this->mConds[] = 'log_type != ' . $this->mDb->addQuotes( $type ); - } + $hide = $this->getRequest()->getInt( "hide_{$type}_log", $default ); + + $filters[$type] = $hide; + if ( $hide ) { + $this->mConds[] = 'log_type != ' . $this->mDb->addQuotes( $type ); } } -- 2.20.1