Fix default value of the SpecialWatchlistFilters hook
[lhc/web/wiklou.git] / includes / specials / SpecialWatchlist.php
index 7114fc9..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
@@ -200,7 +200,6 @@ class SpecialWatchlist extends SpecialPage {
 
                # Up estimate of watched items by 15% to compensate for talk pages...
 
-
                # Toggles
                if( $values['hideOwn'] ) {
                        $conds[] = 'rc_user != ' . $user->getId();
@@ -504,4 +503,8 @@ class SpecialWatchlist extends SpecialPage {
 
                return floor( $count / 2 );
        }
+
+       protected function getGroupName() {
+               return 'changes';
+       }
 }