Fix default value of the SpecialWatchlistFilters hook
authorMarius Hoch <hoo@online.de>
Tue, 12 Mar 2013 20:14:06 +0000 (21:14 +0100)
committerMarius Hoch <hoo@online.de>
Tue, 12 Mar 2013 20:30:33 +0000 (21:30 +0100)
The documented default value of the SpecialWatchlistFilters hook
didn't work. Fixed this to work like the built in defaults.

This keeps the b/c with uses which default to false (the only
use I'm aware of is in FlaggedRevs and that defaults to false)

(I want to use this in Wikibase Client)

Change-Id: I79811e9f3e7431e3403cf93674667d624d3d4db2

includes/specials/SpecialWatchlist.php

index 89c2e76..f52c9a7 100644 (file)
@@ -116,7 +116,7 @@ class SpecialWatchlist extends SpecialPage {
                $this->customFilters = array();
                wfRunHooks( 'SpecialWatchlistFilters', array( $this, &$this->customFilters ) );
                foreach( $this->customFilters as $key => $params ) {
-                       $defaults[$key] = $params['msg'];
+                       $defaults[$key] = $params['default'];
                }
 
                # Extract variables from the request, falling back to user preferences or
@@ -131,7 +131,7 @@ class SpecialWatchlist extends SpecialPage {
                $values['hidePatrolled'] = (int)$request->getBool( 'hidePatrolled', $defaults['hidePatrolled'] );
                $values['extended'] = (int)$request->getBool( 'extended', $defaults['extended'] );
                foreach( $this->customFilters as $key => $params ) {
-                       $values[$key] = (int)$request->getBool( $key );
+                       $values[$key] = (int)$request->getBool( $key, $defaults[$key] );
                }
 
                # Get namespace value, if supplied, and prepare a WHERE fragment