IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/49622


Change subject: Pass all non-default values as hidden field in namespace form 
on Special:Watchlist
......................................................................

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
---
M includes/specials/SpecialWatchlist.php
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/22/49622/1

diff --git a/includes/specials/SpecialWatchlist.php 
b/includes/specials/SpecialWatchlist.php
index 39bf14c..f97e5b8 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -343,6 +343,11 @@
                        $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;
@@ -375,11 +380,8 @@
                        array( 'title' => $this->msg( 
'tooltip-namespace_association' )->text() )
                ) . ' ';
                $form .= Xml::submitButton( $this->msg( 'allpagessubmit' 
)->text() ) . '</p>';
-               $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' );

-- 
To view, visit https://gerrit.wikimedia.org/r/49622
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb0d3b1d6b4827d35ac9b09eb4d8a5ae630a0e3a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to