From: Marius Hoch Date: Tue, 12 Mar 2013 20:14:06 +0000 (+0100) Subject: Fix default value of the SpecialWatchlistFilters hook X-Git-Tag: 1.31.0-rc.0~20341^2 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=16a1b3503e9f3e029dab9fd8714ca85768809816;p=lhc%2Fweb%2Fwiklou.git 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 --- 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