$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 );
+ // HACK work around ChangeTags::truncateTagDescription() requiring a RequestContext
+ $fakeContext = RequestContext::newExtraneousContext( Title::newFromText( 'Dwimmerlaik' ) );
+ $fakeContext->setLanguage( Language::factory( $context->getLanguage() ) );
+
// Build the list and data
$result = [];
foreach ( $tagHitCounts as $tagName => $hits ) {