(bug 21536) Fix JS error on Special:Search caused by not using the ID mwsuggest.js...
authorAlex Z <mrzman@users.mediawiki.org>
Wed, 16 Dec 2009 00:47:57 +0000 (00:47 +0000)
committerAlex Z <mrzman@users.mediawiki.org>
Wed, 16 Dec 2009 00:47:57 +0000 (00:47 +0000)
RELEASE-NOTES
includes/specials/SpecialSearch.php

index 2879208..815009a 100644 (file)
@@ -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 ==
 
index a58c95d..630a9ff 100644 (file)
@@ -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";