r107315 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107314‎ | r107315 | r107316 >
Date:06:34, 26 December 2011
Author:kaldari
Status:resolved (Comments)
Tags:
Comment:
fix for bug 33372, disabling CentralNotice on Special pages
Modified paths:
  • /trunk/extensions/CentralNotice/special/SpecialBannerController.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/special/SpecialBannerController.php
@@ -87,11 +87,13 @@
8888 $wgContLang->specialPage( 'BannerListLoader' ) .
8989 "') + '&cache=/cn.js&' + bannerListQuery;\n";
9090 $js .= <<<JAVASCRIPT
91 - var request = $.ajax( {
92 - url: bannerListURL,
93 - dataType: 'json',
94 - success: $.centralNotice.fn.chooseBanner
95 - } );
 91+ if ( wgNamespaceNumber !== -1 ) { // disable loading banners on Special pages
 92+ var request = $.ajax( {
 93+ url: bannerListURL,
 94+ dataType: 'json',
 95+ success: $.centralNotice.fn.chooseBanner
 96+ } );
 97+ }
9698 },
9799 'chooseBanner': function( bannerList ) {
98100 // Convert the json object to a true array

Follow-up revisions

RevisionCommit summaryAuthorDate
r107357[CentralNotice] Re-apply r107315, accidentally reverted in r107349...krinkle02:30, 27 December 2011

Comments

#Comment by Krinkle (talk | contribs)   02:31, 27 December 2011
+				if ( wgNamespaceNumber !== -1 ) { // disable loading banners on Special pages

Use mw.config as the wg globals are deprecated in JavaScript and some wikis may even have them removed/disabled.

#Comment by P858snake (talk | contribs)   09:50, 28 December 2011

Can someone tag this for 1.18wmf1, Although the points used in the bug are unlikely, It could possibly be done.

#Comment by Duplicatebug (talk | contribs)   17:21, 30 December 2011

I am not sure, if disabling on Special:Watchlist is good, because some users are only checking his watchlist (per bookmark and activ remember me cookie), to see, if some important thing is one the wiki and not looking at any other pages. When the CentralNotice is a maintenance warning or so, that is very useful to know.

Status & tagging log