SpecialBooksources: Fix submitting the form from a subpage link
authorKunal Mehta <legoktm@member.fsf.org>
Sun, 16 Oct 2016 00:01:15 +0000 (17:01 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Sun, 16 Oct 2016 00:02:55 +0000 (17:02 -0700)
Visiting Special:Booksources/.... and then trying to enter a new
ISBN in the form field didn't work because the $par would take
precedence over the query parameter.

Removing the subpage from the HTMLForm context apparently fixes this.

Change-Id: Ia007648e23beadcc017e117e59ce3df1b329dcdc

includes/specials/SpecialBooksources.php

index 2fef725..72e0b88 100644 (file)
@@ -133,7 +133,9 @@ class SpecialBookSources extends SpecialPage {
                        ],
                ];
 
-               HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() )
+               $context = new DerivativeContext( $this->getContext() );
+               $context->setTitle( $this->getPageTitle() );
+               HTMLForm::factory( 'ooui', $formDescriptor, $context )
                        ->setWrapperLegendMsg( 'booksources-search-legend' )
                        ->setSubmitTextMsg( 'booksources-search' )
                        ->setMethod( 'get' )