From: Roan Kattouw Date: Tue, 19 Feb 2019 20:53:53 +0000 (-0800) Subject: RCFilters: Don't show tags with 0 hits in tag menu X-Git-Tag: 1.34.0-rc.0~2781^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=a064c57f51456c24499ee36a11519ec047f1fee9;p=lhc%2Fweb%2Fwiklou.git RCFilters: Don't show tags with 0 hits in tag menu Bug: T182219 Change-Id: Id6b4c6fe652c15388f0d6b37912cb582ea205a47 --- diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index ea1cf59384..dfdbc07d52 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -848,23 +848,23 @@ abstract class ChangesListSpecialPage extends SpecialPage { $explicitlyDefinedTags = array_fill_keys( ChangeTags::listExplicitlyDefinedTags(), 0 ); $softwareActivatedTags = array_fill_keys( ChangeTags::listSoftwareActivatedTags(), 0 ); - // Hit counts disabled for perf reasons, see T169997 - /* $tagStats = ChangeTags::tagUsageStatistics(); $tagHitCounts = array_merge( $explicitlyDefinedTags, $softwareActivatedTags, $tagStats ); - // Sort by hits - arsort( $tagHitCounts ); - */ - $tagHitCounts = array_merge( $explicitlyDefinedTags, $softwareActivatedTags ); + // Sort by hits (disabled for now) + //arsort( $tagHitCounts ); // Build the list and data $result = []; foreach ( $tagHitCounts as $tagName => $hits ) { if ( - // Only get active tags - isset( $explicitlyDefinedTags[ $tagName ] ) || - isset( $softwareActivatedTags[ $tagName ] ) + ( + // Only get active tags + isset( $explicitlyDefinedTags[ $tagName ] ) || + isset( $softwareActivatedTags[ $tagName ] ) + ) && + // Only get tags with more than 0 hits + $hits > 0 ) { $result[] = [ 'name' => $tagName,