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
This commit is contained in:
Brian Wolff 2017-10-14 03:20:10 +00:00
parent 1686d396db
commit eb1caed560
3 changed files with 19 additions and 7 deletions

View 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 ===

View 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;

View 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 );
}
}