From c62ae8d27b3bc1aef02311939a22b2514a20a33c Mon Sep 17 00:00:00 2001 From: Alex Z Date: Wed, 16 Dec 2009 00:47:57 +0000 Subject: [PATCH] (bug 21536) Fix JS error on Special:Search caused by not using the ID mwsuggest.js expects on the input for advanced search --- RELEASE-NOTES | 1 + includes/specials/SpecialSearch.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 28792086c0..815009a012 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -683,6 +683,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN groups if there are duplicate entries * (bug 21814) Message shown when rolling back an edit with a deleted username now shows '(username deleted)' instead of broken user tool links +* (bug 21536) Fixed JavaScript error on Special:Search caused by an incorrect ID == API changes in 1.16 == diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index a58c95dfdf..630a9ffaeb 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -811,9 +811,10 @@ class SpecialSearch { } protected function searchFocus() { + $id = $this->searchAdvanced ? 'powerSearchText' : 'searchText'; return Html::inlineScript( "hookEvent(\"load\", function() {" . - "document.getElementById('searchText').focus();" . + "document.getElementById('$id').focus();" . "});" ); } @@ -943,7 +944,7 @@ class SpecialSearch { $out .= Html::hidden( "redirs", (int)$this->searchRedirects ) . "\n"; // Term box $out .= Html::input( 'search', $term, 'search', array( - 'id' => 'searchText', + 'id' => $this->searchAdvanced ? 'powerSearchText' : 'searchText', 'size' => '50', 'autofocus' ) ) . "\n"; -- 2.20.1