code-quality: Special:PrefixIndex is transcludable
authorDanny B <danny.b@email.cz>
Sat, 7 Dec 2013 02:57:16 +0000 (03:57 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 5 Mar 2014 12:15:45 +0000 (13:15 +0100)
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
includes/specials/SpecialPrefixindex.php
resources/mediawiki.special/mediawiki.special.css
tests/parser/parserTests.txt

index 382b54f..e7ae193 100644 (file)
@@ -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)
index 4548b63..8137651 100644 (file)
@@ -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() ) ) {
index ee4fc06..a877b74 100644 (file)
@@ -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%;
 }
index a868214..02863c8 100644 (file)
@@ -13163,7 +13163,7 @@ Special page transclusion
 !! input
 {{Special:Prefixindex/Xyzzyx}}
 !! result
-<table id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
+<table class="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
 
 !! end
 
@@ -13174,8 +13174,8 @@ Special page transclusion twice (bug 5021)
 {{Special:Prefixindex/Xyzzyx}}
 {{Special:Prefixindex/Xyzzyx}}
 !! result
-<table id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
-<table id="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
+<table class="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
+<table class="mw-prefixindex-list-table"><tr><td><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></td></tr></table>
 
 !! end