From e611058226ff02b2e20f3f4e3a8f56189f43871b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Sun, 24 Nov 2013 22:24:44 +0100 Subject: [PATCH] Always load 'mediawiki.special.changeslist' on appropriate pages It is also loaded by ChangesList (and subclasses), but the changes list might not get a chance to ever execute that code if there are no changes to show. This fixes an issue where the legend would sometimes display unstyled on Special:RecentChangesLinked. Bug: 59959 Change-Id: Ia1741306303aa3d2641b47bf19efef540ec64779 --- includes/specials/SpecialRecentchanges.php | 8 +++++--- includes/specials/SpecialWatchlist.php | 2 -- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index a4e0b85c9c..90abe1ca3f 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -978,9 +978,11 @@ class SpecialRecentChanges extends SpecialPage { * Add page-specific modules. */ protected function addModules() { - $this->getOutput()->addModules( array( - 'mediawiki.special.recentchanges', - ) ); + $out = $this->getOutput(); + $out->addModules( 'mediawiki.special.recentchanges' ); + // This modules include styles and behavior for the legend box, load it unconditionally + $out->addModuleStyles( 'mediawiki.special.changeslist' ); + $out->addModules( 'mediawiki.special.changeslist.js' ); } protected function getGroupName() { diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index bb285fda8b..28b4041982 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -136,8 +136,6 @@ class SpecialWatchlist extends SpecialRecentChanges { $user = $this->getUser(); $output = $this->getOutput(); - $output->addModuleStyles( 'mediawiki.special.changeslist' ); - $output->addModules( 'mediawiki.special.changeslist.js' ); # Anons don't get a watchlist $this->requireLogin( 'watchlistanontext' ); -- 2.20.1