From 16a1b3503e9f3e029dab9fd8714ca85768809816 Mon Sep 17 00:00:00 2001 From: Marius Hoch Date: Tue, 12 Mar 2013 21:14:06 +0100 Subject: [PATCH] Fix default value of the SpecialWatchlistFilters hook 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 89c2e76a57..f52c9a7103 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -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 -- 2.20.1