From 7c20a005e9e4f57350225d285a6aeb167afbff3e Mon Sep 17 00:00:00 2001 From: Aaron Pramana Date: Sun, 20 May 2012 20:21:33 -0700 Subject: [PATCH] (bug 36761) "Mark pages as visited" should submit previously established filter options The form was missing the hidden inputs containing the filter options already selected. This change fixes adds those inputs. Change-Id: I67f3b34672c52c13789a967e81e0cb32813b2be2 --- RELEASE-NOTES-1.20 | 1 + includes/specials/SpecialWatchlist.php | 31 ++++++++++++++------------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index 8875eeb141..c8960f046f 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -125,6 +125,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki. * (bug 34927) Output media_type for list=filearchive * (bug 28814) add properties to output of action=parse * (bug 33224) add variants of content language to meta=siteinfo +* (bug 36761) "Mark pages as visited" now submits previously established filter options === Languages updated in 1.20 === diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index eafdde4ba5..a81eb5bf6f 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -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 ? '!=' : '='; + $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 ); + $associatedNS = MWNamespace::getAssociated( $nameSpace ); $nameSpaceClause = - "rc_namespace $eq_op $nameSpace " . - $bool_op . + "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 .= '
'; -- 2.20.1