Always load 'mediawiki.special.changeslist' on appropriate pages
authorBartosz Dziewoński <matma.rex@gmail.com>
Sun, 24 Nov 2013 21:24:44 +0000 (22:24 +0100)
committerOri.livneh <ori@wikimedia.org>
Wed, 15 Jan 2014 00:07:27 +0000 (00:07 +0000)
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
includes/specials/SpecialWatchlist.php

index a4e0b85..90abe1c 100644 (file)
@@ -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() {
index bb285fd..28b4041 100644 (file)
@@ -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' );