Fix "Bad value 1 for attribute autofocus" on special pages
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 14 Jan 2015 18:36:52 +0000 (19:36 +0100)
committerNikerabbit <niklas.laxstrom@gmail.com>
Wed, 18 Mar 2015 14:27:52 +0000 (14:27 +0000)
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

includes/specials/SpecialBooksources.php
includes/specials/SpecialExpandTemplates.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUserrights.php

index 91a148d..7028fdc 100644 (file)
@@ -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 .= '&#160;' . Html::submitButton(
index 891ea01..b7582e6 100644 (file)
@@ -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' )
                ) . '</p>';
                $form .= '<p>' . Xml::label(
                        $this->msg( 'expand_templates_input' )->text(),
index 205e2f4..de2365e 100644 (file)
@@ -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' => '' )
                                ) .
                                "</td>
                        </tr>
index 7dd2b87..785a844 100644 (file)
@@ -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
                                )
                        ) . ' ' .