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
$this->customFilters = array();
wfRunHooks( 'SpecialWatchlistFilters', array( $this, &$this->customFilters ) );
foreach( $this->customFilters as $key => $params ) {
$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
}
# Extract variables from the request, falling back to user preferences or
$values['hidePatrolled'] = (int)$request->getBool( 'hidePatrolled', $defaults['hidePatrolled'] );
$values['extended'] = (int)$request->getBool( 'extended', $defaults['extended'] );
foreach( $this->customFilters as $key => $params ) {
$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
}
# Get namespace value, if supplied, and prepare a WHERE fragment