No longer special case 'patrol' in $wgFilterLogTypes
authorBrian Wolff <bawolff+wn@gmail.com>
Sat, 14 Oct 2017 03:20:10 +0000 (03:20 +0000)
committerBrian Wolff <bawolff+wn@gmail.com>
Sat, 28 Oct 2017 13:08:43 +0000 (13:08 +0000)
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
includes/DefaultSettings.php
includes/logging/LogPager.php

index a4ce481..b5ec0d6 100644 (file)
@@ -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 ===
index 040f1ce..497b86d 100644 (file)
@@ -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;
index f79fcfa..df432e1 100644 (file)
@@ -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 );
                        }
                }