Merge "Notice: Undefined property: stdClass::$hitcount in list=tags"
[lhc/web/wiklou.git] / includes / specials / SpecialWatchlist.php
index eafdde4..a81eb5b 100644 (file)
@@ -91,14 +91,6 @@ class SpecialWatchlist extends SpecialPage {
                        return;
                }
 
-               if( ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) && $request->getVal( 'reset' ) &&
-                       $request->wasPosted() )
-               {
-                       $user->clearAllNotifications();
-                       $output->redirect( $this->getTitle()->getFullUrl() );
-                       return;
-               }
-
                $nitems = $this->countItems();
                if ( $nitems == 0 ) {
                        $output->addWikiMsg( 'nowatchlist' );
@@ -152,16 +144,16 @@ class SpecialWatchlist extends SpecialPage {
                $invert = $request->getBool( 'invert' );
                $associated = $request->getBool( 'associated' );
                if ( !is_null( $nameSpace ) ) {
-                       $eq_op = $invert ? '!=' : '=';\r
+                       $eq_op = $invert ? '!=' : '=';
                        $bool_op = $invert ? 'AND' : 'OR';
                        $nameSpace = intval( $nameSpace ); // paranioa
                        if ( !$associated ) {
                                $nameSpaceClause = "rc_namespace $eq_op $nameSpace";
                        } else {
-                               $associatedNS = MWNamespace::getAssociated( $nameSpace );\r
+                               $associatedNS = MWNamespace::getAssociated( $nameSpace );
                                $nameSpaceClause =
-                                       "rc_namespace $eq_op $nameSpace " .\r
-                                       $bool_op .\r
+                                       "rc_namespace $eq_op $nameSpace " .
+                                       $bool_op .
                                        " rc_namespace $eq_op $associatedNS";
                        }
                } else {
@@ -190,6 +182,14 @@ class SpecialWatchlist extends SpecialPage {
                        wfAppendToArrayIfNotDefault( $name, $values[$name], $defaults, $nondefaults );
                }
 
+               if( ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) && $request->getVal( 'reset' ) &&
+                       $request->wasPosted() )
+               {
+                       $user->clearAllNotifications();
+                       $output->redirect( $this->getTitle()->getFullUrl( $nondefaults ) );
+                       return;
+               }
+
                $dbr = wfGetDB( DB_SLAVE, 'watchlist' );
 
                # Possible where conditions
@@ -263,8 +263,11 @@ class SpecialWatchlist extends SpecialPage {
                                                'id' => 'mw-watchlist-resetbutton' ) ) .
                                        $this->msg( 'wlheader-showupdated' )->parse() . ' ' .
                                        Xml::submitButton( $this->msg( 'enotif_reset' )->text(), array( 'name' => 'dummy' ) ) .
-                                       Html::hidden( 'reset', 'all' ) .
-                                       Xml::closeElement( 'form' );
+                                       Html::hidden( 'reset', 'all' );
+                                       foreach ( $nondefaults as $key => $value ) {
+                                               $form .= Html::hidden( $key, $value );
+                                       }
+                                       $form .= Xml::closeElement( 'form' );
                }
                $form .= '<hr />';