From: Eddie Greiner-Petter Date: Sat, 4 Mar 2017 00:27:51 +0000 (+0100) Subject: Remove redundant input from search form X-Git-Tag: 1.31.0-rc.0~3891^2 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=d6709386bfee2c20231e6bb543fc46659aed54b1;p=lhc%2Fweb%2Fwiklou.git Remove redundant input from search form 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 --- diff --git a/includes/widget/search/SearchFormWidget.php b/includes/widget/search/SearchFormWidget.php index b8d415f695..a7407a062f 100644 --- a/includes/widget/search/SearchFormWidget.php +++ b/includes/widget/search/SearchFormWidget.php @@ -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; }