Remove redundant input from search form
authorEddie Greiner-Petter <git@eddie-sh.de>
Sat, 4 Mar 2017 00:27:51 +0000 (01:27 +0100)
committerEddie Greiner-Petter <git@eddie-sh.de>
Sat, 4 Mar 2017 00:41:19 +0000 (01:41 +0100)
A hidden input 'profile' gets added within the search form widget no
matter what profile is loaded at the moment.  This is done in
shortDialogHtml along with a few other hidden fields. The same hidden
field is added a second time in optionsHtml if the profile 'advanced' is
run. Remove this redundance.

Bug: T158869
Change-Id: I3be598702dbe9fa2cfe0fdd6c23fe6d88477626d

includes/widget/search/SearchFormWidget.php

index b8d415f..a7407a0 100644 (file)
@@ -206,16 +206,13 @@ class SearchFormWidget {
         */
        protected function optionsHtml( $term, $isPowerSearch, $profile ) {
                $html = '';
-               $opts = [
-                       'profile' => $profile,
-               ];
 
                if ( $isPowerSearch ) {
-                       $html .= $this->powerSearchBox( $term, $opts );
+                       $html .= $this->powerSearchBox( $term, [] );
                } else {
                        $form = '';
                        Hooks::run( 'SpecialSearchProfileForm', [
-                               $this->specialSearch, &$form, $profile, $term, $opts
+                               $this->specialSearch, &$form, $profile, $term, []
                        ] );
                        $html .= $form;
                }