Special:PrefixIndex: Fix regression on prefix input value
authorVolker E <volker.e@wikimedia.org>
Sat, 5 May 2018 23:19:08 +0000 (16:19 -0700)
committerVolker E <volker.e@wikimedia.org>
Tue, 15 May 2018 02:54:27 +0000 (19:54 -0700)
Regression introduced in Ieb9713f8346316e9c3cf1e83eae00848f3921b43

Bug: T193927
Change-Id: I9a3477af89a7e303a67f1769859a649b86113604

includes/specials/SpecialPrefixindex.php

index 9ff6d70..b07869c 100644 (file)
@@ -102,8 +102,10 @@ class SpecialPrefixindex extends SpecialAllPages {
                        'prefix' => [
                                'label-message' => 'allpagesprefix',
                                'name' => 'prefix',
+                               'id' => 'nsfrom',
                                'type' => 'text',
                                'size' => '30',
+                               'default' => str_replace( '_', ' ', $from ),
                        ],
                        'namespace' => [
                                'type' => 'namespaceselect',
@@ -111,7 +113,7 @@ class SpecialPrefixindex extends SpecialAllPages {
                                'id' => 'namespace',
                                'label-message' => 'namespace',
                                'all' => null,
-                               'value' => $namespace,
+                               'default' => $namespace,
                        ],
                        'hidedirects' => [
                                'class' => 'HTMLCheckField',
@@ -124,7 +126,9 @@ class SpecialPrefixindex extends SpecialAllPages {
                                'label-message' => 'prefixindex-strip',
                        ],
                ];
-               $htmlForm = new HTMLForm( $formDescriptor, $this->getContext() );
+               $context = new DerivativeContext( $this->getContext() );
+               $context->setTitle( $this->getPageTitle() ); // Remove subpage
+               $htmlForm = new HTMLForm( $formDescriptor, $context );
                $htmlForm
                        ->setMethod( 'get' )
                        ->setWrapperLegendMsg( 'allpages' )