From 644ee1a5370d84541681d02cee0e4460aa825a00 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 18 Feb 2013 10:45:49 +0100 Subject: [PATCH] Pass all non-default values as hidden field in namespace form on Special:Watchlist Except 'namespace', 'invert' and 'associated' which are displayed in the form. This allows to forward all parameters that were modified using query string, e.g. the new 'extended' parameter added in I115544005a621ee01a0ed0970a13099af92f42e7 that would be lost otherwise when using the form. Change-Id: Idb0d3b1d6b4827d35ac9b09eb4d8a5ae630a0e3a --- includes/specials/SpecialWatchlist.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 7033de6cbe..2132b65b47 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -333,6 +333,11 @@ class SpecialWatchlist extends SpecialPage { $links[] = $this->showHideLink( $nondefaults, $msg, $name, $values[$name] ); } + $hiddenFields = $nondefaults; + unset( $hiddenFields['namespace'] ); + unset( $hiddenFields['invert'] ); + unset( $hiddenFields['associated'] ); + # Namespace filter and put the whole form together. $form .= $wlInfo; $form .= $cutofflinks; @@ -365,11 +370,8 @@ class SpecialWatchlist extends SpecialPage { array( 'title' => $this->msg( 'tooltip-namespace_association' )->text() ) ) . ' '; $form .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . '

'; - $form .= Html::hidden( 'days', $values['days'] ); - foreach ( $filters as $key => $msg ) { - if ( $values[$key] ) { - $form .= Html::hidden( $key, 1 ); - } + foreach ( $hiddenFields as $key => $value ) { + $form .= Html::hidden( $key, $value ); } $form .= Xml::closeElement( 'form' ); $form .= Xml::closeElement( 'fieldset' ); -- 2.20.1