From: Alexandre Emsenhuber Date: Mon, 18 Feb 2013 09:45:49 +0000 (+0100) Subject: Pass all non-default values as hidden field in namespace form on Special:Watchlist X-Git-Tag: 1.31.0-rc.0~20642 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=644ee1a5370d84541681d02cee0e4460aa825a00;p=lhc%2Fweb%2Fwiklou.git 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 --- 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' );