r60111 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60110‎ | r60111 | r60112 >
Date:00:47, 16 December 2009
Author:mrzman
Status:ok (Comments)
Tags:
Comment:
(bug 21536) Fix JS error on Special:Search caused by not using the ID mwsuggest.js expects on the input for advanced search
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -811,9 +811,10 @@
812812 }
813813
814814 protected function searchFocus() {
 815+ $id = $this->searchAdvanced ? 'powerSearchText' : 'searchText';
815816 return Html::inlineScript(
816817 "hookEvent(\"load\", function() {" .
817 - "document.getElementById('searchText').focus();" .
 818+ "document.getElementById('$id').focus();" .
818819 "});" );
819820 }
820821
@@ -943,7 +944,7 @@
944945 $out .= Html::hidden( "redirs", (int)$this->searchRedirects ) . "\n";
945946 // Term box
946947 $out .= Html::input( 'search', $term, 'search', array(
947 - 'id' => 'searchText',
 948+ 'id' => $this->searchAdvanced ? 'powerSearchText' : 'searchText',
948949 'size' => '50',
949950 'autofocus'
950951 ) ) . "\n";
Index: trunk/phase3/RELEASE-NOTES
@@ -683,6 +683,7 @@
684684 groups if there are duplicate entries
685685 * (bug 21814) Message shown when rolling back an edit with a deleted username
686686 now shows '(username deleted)' instead of broken user tool links
 687+* (bug 21536) Fixed JavaScript error on Special:Search caused by an incorrect ID
687688
688689 == API changes in 1.16 ==
689690

Comments

#Comment by Platonides (talk | contribs)   21:05, 9 June 2010

This looks a bug on mwsuggest, not on Special:Search. This breaks custom javascript by changing the id for no reason.

Status & tagging log