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

Change subject: Remove table header from Special:Tags when there are no tags
......................................................................


Remove table header from Special:Tags when there are no tags

The table header shows up even when there are no tags to be
listed in the table. This patch fixes the same

Bug: T92728
Change-Id: I22d2c0435bc365f65354cea604b1c87905c769f8
---
M includes/specials/SpecialTags.php
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Umherirrender: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialTags.php 
b/includes/specials/SpecialTags.php
index ff263b6..0b8147e 100644
--- a/includes/specials/SpecialTags.php
+++ b/includes/specials/SpecialTags.php
@@ -114,6 +114,12 @@
                $showActions = $user->isAllowed( 'managechangetags' );
 
                // Write the headers
+               $tagUsageStatistics = ChangeTags::tagUsageStatistics();
+
+               // Show header only if there exists atleast one tag
+               if ( !$tagUsageStatistics ) {
+                       return;
+               }
                $html = Xml::tags( 'tr', null, Xml::tags( 'th', null, 
$this->msg( 'tags-tag' )->parse() ) .
                        Xml::tags( 'th', null, $this->msg( 
'tags-display-header' )->parse() ) .
                        Xml::tags( 'th', null, $this->msg( 
'tags-description-header' )->parse() ) .
@@ -134,7 +140,7 @@
                $this->extensionActivatedTags = array_fill_keys(
                        ChangeTags::listExtensionActivatedTags(), true );
 
-               foreach ( ChangeTags::tagUsageStatistics() as $tag => $hitcount 
) {
+               foreach ( $tagUsageStatistics as $tag => $hitcount ) {
                        $html .= $this->doTagRow( $tag, $hitcount, $showActions 
);
                }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I22d2c0435bc365f65354cea604b1c87905c769f8
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Tinaj1234 <[email protected]>
Gerrit-Reviewer: 01tonythomas <[email protected]>
Gerrit-Reviewer: Brian Wolff <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Qgil <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to