From 43bf02c953d0640a92a11b7302a184d330040492 Mon Sep 17 00:00:00 2001 From: Danny B Date: Sat, 7 Dec 2013 03:57:16 +0100 Subject: [PATCH] code-quality: Special:PrefixIndex is transcludable Replacing 'id' attribute with 'class' to prevent pages' HTML from becoming invalid due to using the same id. Change-Id: Ibf561318a5005424e8920e693a62ccdb05bbd765 --- RELEASE-NOTES-1.23 | 3 +++ includes/specials/SpecialPrefixindex.php | 2 +- resources/mediawiki.special/mediawiki.special.css | 3 ++- tests/parser/parserTests.txt | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23 index 382b54f06e..e7ae1934f6 100644 --- a/RELEASE-NOTES-1.23 +++ b/RELEASE-NOTES-1.23 @@ -265,6 +265,9 @@ changes to languages because of Bugzilla reports. * The jquery.delayedBind ResourceLoader module was deprecated in favor of the jquery.throttle-debounce module. It will be removed in MediaWiki 1.24. * mw.user.bucket has been deprecated. +* On Special:PrefixIndex, a table#mw-prefixindex-list-table was changed to + table.mw-prefixindex-list-table to avoid duplicate ids when the special page + is transcluded. ==== Removed classes ==== * FakeMemCachedClient (deprecated in 1.18) diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index 4548b634cd..81376518f5 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -203,7 +203,7 @@ class SpecialPrefixindex extends SpecialAllpages { $n = 0; if ( $res->numRows() > 0 ) { - $out = Xml::openElement( 'table', array( 'id' => 'mw-prefixindex-list-table' ) ); + $out = Xml::openElement( 'table', array( 'class' => 'mw-prefixindex-list-table' ) ); $prefixLength = strlen( $prefix ); while ( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) { diff --git a/resources/mediawiki.special/mediawiki.special.css b/resources/mediawiki.special/mediawiki.special.css index ee4fc06aad..a877b745d2 100644 --- a/resources/mediawiki.special/mediawiki.special.css +++ b/resources/mediawiki.special/mediawiki.special.css @@ -66,7 +66,8 @@ table.mw-listgrouprights-table tr { } /**** Special:Prefixindex ****/ -table#mw-prefixindex-list-table, +table#mw-prefixindex-list-table, /* HTML backwards-compatibility, to be removed before 1.23 */ +table.mw-prefixindex-list-table, table#mw-prefixindex-nav-table { width: 98%; } diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index a868214ded..02863c817a 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -13163,7 +13163,7 @@ Special page transclusion !! input {{Special:Prefixindex/Xyzzyx}} !! result -
Xyzzyx
+
Xyzzyx
!! end @@ -13174,8 +13174,8 @@ Special page transclusion twice (bug 5021) {{Special:Prefixindex/Xyzzyx}} {{Special:Prefixindex/Xyzzyx}} !! result -
Xyzzyx
-
Xyzzyx
+
Xyzzyx
+
Xyzzyx
!! end -- 2.20.1