Special:AllPages: Overriding the title for form submission
authorJayprakash12345 <0freerunning@gmail.com>
Tue, 8 May 2018 20:21:43 +0000 (01:51 +0530)
committerBartosz Dziewoński <matma.rex@gmail.com>
Fri, 18 May 2018 11:27:15 +0000 (11:27 +0000)
Bug: T193965
Change-Id: I10867b89e94d9aa54f30f5f4f8b5974f68479f6f

includes/specials/SpecialAllPages.php

index f9c917d..ef05dd1 100644 (file)
@@ -126,7 +126,7 @@ class SpecialAllPages extends IncludableSpecialPage {
                                'id' => 'namespace',
                                'label-message' => 'namespace',
                                'all' => null,
-                               'value' => $namespace,
+                               'default' => $namespace,
                        ],
                        'hideredirects' => [
                                'type' => 'check',
@@ -141,7 +141,9 @@ class SpecialAllPages extends IncludableSpecialPage {
                        unset( $fields['hideredirects'] );
                }
 
-               $form = HTMLForm::factory( 'table', $fields, $this->getContext() );
+               $context = new DerivativeContext( $this->getContext() );
+               $context->setTitle( $this->getPageTitle() ); // Remove subpage
+               $form = HTMLForm::factory( 'table', $fields, $context );
                $form->setMethod( 'get' )
                        ->setWrapperLegendMsg( 'allpages' )
                        ->setSubmitTextMsg( 'allpagessubmit' )