jenkins-bot has submitted this change and it was merged.

Change subject: Add category name in ID property for extension row in 
Special:Version page
......................................................................


Add category name in ID property for extension row in Special:Version page

Extensions can belong to multiple different categories. When listing them in
the Special:Version page each entry is surrounded with HTML element with
ID property "mw-version-ext-{NAME}". This causes generation of duplicate
ID values, which is against W3C rules.
To preserve valid and compliant HTML while retaining ID values, change the
ID pattern to "mw-version-ext-{CATEGORY}-{NAME}".

Bug: T99025
Change-Id: Ifdde0704631f1ef41e4c83e7e8116003983e0808
---
M includes/specials/SpecialVersion.php
1 file changed, 4 insertions(+), 3 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve
  Jdlrobson: Looks good to me, but someone else must approve
  Florianschmidtwelzow: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialVersion.php 
b/includes/specials/SpecialVersion.php
index c8b85ae..2cd492e 100644
--- a/includes/specials/SpecialVersion.php
+++ b/includes/specials/SpecialVersion.php
@@ -633,7 +633,7 @@
                        usort( $wgExtensionCredits[$type], [ $this, 'compare' ] 
);
 
                        foreach ( $wgExtensionCredits[$type] as $extension ) {
-                               $out .= $this->getCreditsForExtension( 
$extension );
+                               $out .= $this->getCreditsForExtension( $type, 
$extension );
                        }
                }
 
@@ -669,11 +669,12 @@
         *  - Description of extension (descriptionmsg or description)
         *  - List of authors (author) and link to a 
((AUTHORS)|(CREDITS))(\.txt)? file if it exists
         *
+        * @param string $type Category name of the extension
         * @param array $extension
         *
         * @return string Raw HTML
         */
-       public function getCreditsForExtension( array $extension ) {
+       public function getCreditsForExtension( $type, array $extension ) {
                $out = $this->getOutput();
 
                // We must obtain the information for all the bits and pieces!
@@ -830,7 +831,7 @@
                // Finally! Create the table
                $html = Html::openElement( 'tr', [
                                'class' => 'mw-version-ext',
-                               'id' => Sanitizer::escapeId( 'mw-version-ext-' 
. $extension['name'] )
+                               'id' => Sanitizer::escapeId( 'mw-version-ext-' 
. $type . '-' . $extension['name'] )
                        ]
                );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/275836
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifdde0704631f1ef41e4c83e7e8116003983e0808
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ferveo <ramu...@geciauskas.com>
Gerrit-Reviewer: Ferveo <ramu...@geciauskas.com>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Ricordisamoa <ricordisa...@openmailbox.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to