From f684e673c0a52ea8193f3c77b9c7026513fe8f36 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 26 Jul 2017 02:21:44 +0200 Subject: [PATCH] Fix Special:ListUsers "subpage parameter" handling * Set the form action to avoid the subpage being "stuck". This is apparently a common problem and a common workaround, hmm. The $self variable, curiously unused, seems to have been meant for this. * Fix incorrect parameter name to display values from subpage parameters in the form, and preserve them after submission. Bug: T171657 Change-Id: Ibeee545a1e9932dfe44165c34cb55ad87268b705 --- includes/specials/pagers/UsersPager.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/includes/specials/pagers/UsersPager.php b/includes/specials/pagers/UsersPager.php index 10baadfca6..71c0beac4c 100644 --- a/includes/specials/pagers/UsersPager.php +++ b/includes/specials/pagers/UsersPager.php @@ -280,12 +280,12 @@ class UsersPager extends AlphabeticPager { 'class' => 'HTMLUserTextField', 'label' => $this->msg( 'listusersfrom' )->text(), 'name' => 'username', - 'value' => $this->requestedUser, + 'default' => $this->requestedUser, ], 'dropdown' => [ 'label' => $this->msg( 'group' ), 'name' => 'group', - 'value' => $this->requestedGroup, + 'default' => $this->requestedGroup, 'class' => 'HTMLSelectField', 'options' => $groupOptions, ], @@ -294,26 +294,26 @@ class UsersPager extends AlphabeticPager { 'label' => $this->msg( 'listusers-editsonly' )->text(), 'name' => 'editsOnly', 'id' => 'editsOnly', - 'value' => $this->editsOnly + 'default' => $this->editsOnly ], 'creationSort' => [ 'type' => 'check', 'label' => $this->msg( 'listusers-creationsort' )->text(), 'name' => 'creationSort', 'id' => 'creationSort', - 'value' => $this->creationSort + 'default' => $this->creationSort ], 'desc' => [ 'type' => 'check', 'label' => $this->msg( 'listusers-desc' )->text(), 'name' => 'desc', 'id' => 'desc', - 'value' => $this->mDefaultDirection + 'default' => $this->mDefaultDirection ], 'limithiddenfield' => [ 'class' => 'HTMLHiddenField', 'name' => 'limit', - 'value' => $this->mLimit + 'default' => $this->mLimit ] ]; @@ -347,6 +347,7 @@ class UsersPager extends AlphabeticPager { $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() ); $htmlForm ->setMethod( 'get' ) + ->setAction( Title::newFromText( $self )->getLocalURL() ) ->setId( 'mw-listusers-form' ) ->setFormIdentifier( 'mw-listusers-form' ) ->suppressDefaultSubmit() -- 2.20.1