From: umherirrender
Date: Wed, 14 Jan 2015 18:36:52 +0000 (+0100)
Subject: Fix "Bad value 1 for attribute autofocus" on special pages
X-Git-Tag: 1.31.0-rc.0~12062
X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27user%27%2C%20userid=session.user.id%29%20%7D%7D?a=commitdiff_plain;h=c89feebfd0f8308a0be23b254bb62830a235ea0d;p=lhc%2Fweb%2Fwiklou.git
Fix "Bad value 1 for attribute autofocus" on special pages
Xml::inputLabel does not work with boolean parameters, therefore change
true to an empty string to avoid the '1' in html.
This is done for Special:BookSources (from the bug),
Special:ExpandTemplates, Special:Undelete and Special:Userrights
Bug: T68134
Change-Id: I53ff5701840750f17a2ea9a1ec56cd88c00f3cf5
---
diff --git a/includes/specials/SpecialBooksources.php b/includes/specials/SpecialBooksources.php
index 91a148dec0..7028fdcb84 100644
--- a/includes/specials/SpecialBooksources.php
+++ b/includes/specials/SpecialBooksources.php
@@ -135,7 +135,7 @@ class SpecialBookSources extends SpecialPage {
'isbn',
20,
$this->isbn,
- array( 'autofocus' => true, 'class' => 'mw-ui-input-inline' )
+ array( 'autofocus' => '', 'class' => 'mw-ui-input-inline' )
);
$form .= ' ' . Html::submitButton(
diff --git a/includes/specials/SpecialExpandTemplates.php b/includes/specials/SpecialExpandTemplates.php
index 891ea01a23..b7582e6c62 100644
--- a/includes/specials/SpecialExpandTemplates.php
+++ b/includes/specials/SpecialExpandTemplates.php
@@ -154,7 +154,7 @@ class SpecialExpandTemplates extends SpecialPage {
'contexttitle',
60,
$title,
- array( 'autofocus' => true, 'class' => 'mw-ui-input-inline' )
+ array( 'autofocus' => '', 'class' => 'mw-ui-input-inline' )
) . '
';
$form .= '' . Xml::label(
$this->msg( 'expand_templates_input' )->text(),
diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php
index 205e2f416b..de2365e377 100644
--- a/includes/specials/SpecialUndelete.php
+++ b/includes/specials/SpecialUndelete.php
@@ -841,7 +841,7 @@ class SpecialUndelete extends SpecialPage {
'prefix',
20,
$this->mSearchPrefix,
- array( 'id' => 'prefix', 'autofocus' => true )
+ array( 'id' => 'prefix', 'autofocus' => '' )
) . ' ' .
Xml::submitButton( $this->msg( 'undelete-search-submit' )->text() ) .
Xml::closeElement( 'fieldset' ) .
@@ -1314,7 +1314,7 @@ class SpecialUndelete extends SpecialPage {
'wpComment',
50,
$this->mComment,
- array( 'id' => 'wpComment', 'autofocus' => true )
+ array( 'id' => 'wpComment', 'autofocus' => '' )
) .
"
diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php
index 7dd2b87149..785a844a63 100644
--- a/includes/specials/SpecialUserrights.php
+++ b/includes/specials/SpecialUserrights.php
@@ -441,7 +441,7 @@ class UserrightsPage extends SpecialPage {
30,
str_replace( '_', ' ', $this->mTarget ),
array(
- 'autofocus' => true,
+ 'autofocus' => '',
'class' => 'mw-autocomplete-user', // used by mediawiki.userSuggest
)
) . ' ' .