From: Roan Kattouw Date: Wed, 12 Jul 2017 01:01:09 +0000 (-0700) Subject: RCFilters: Don't call ChangeTags::tagUsageStatistics() for now X-Git-Tag: 1.31.0-rc.0~2721^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=b6f412ea2a9e6cd4eaeff0e403466c8b46bbbb29;p=lhc%2Fweb%2Fwiklou.git RCFilters: Don't call ChangeTags::tagUsageStatistics() for now We need to fix its performance first, it currently takes >30s on wikidatawiki. Fake all hit counts to be zero. Instead of sorting by hit count, sort by display name. Bug: T169997 Change-Id: I4075ea4d43a8f75e21a87a892211699ba3bc7058 --- diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 2fe56f989a..15bbffdb1f 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -210,12 +210,16 @@ class SpecialRecentChanges extends ChangesListSpecialPage { protected function buildChangeTagList() { $explicitlyDefinedTags = array_fill_keys( ChangeTags::listExplicitlyDefinedTags(), 0 ); $softwareActivatedTags = array_fill_keys( ChangeTags::listSoftwareActivatedTags(), 0 ); - $tagStats = ChangeTags::tagUsageStatistics(); + // 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 ); // Build the list and data $result = []; @@ -240,6 +244,11 @@ class SpecialRecentChanges extends ChangesListSpecialPage { } } + // Instead of sorting by hit count (disabled, see above), sort by display name + usort( $result, function ( $a, $b ) { + return strcasecmp( $a['label'], $b['label'] ); + } ); + return $result; }