r106849 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106848‎ | r106849 | r106850 >
Date:20:11, 20 December 2011
Author:kaldari
Status:resolved (Comments)
Tags:
Comment:
fixing double-quoting, using json_encode for the campaign list, disabling retrieving stats for now until faulkner can fix the htaccess issue
Modified paths:
  • /trunk/extensions/CentralNotice/bannerstats.js (modified) (history)
  • /trunk/extensions/CentralNotice/special/SpecialBannerAllocation.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/special/SpecialBannerAllocation.php
@@ -181,13 +181,13 @@
182182 }
183183
184184 if ( $banner['campaign'] ) {
185 - $campaigns[] = "'".$banner['campaign']."'";
 185+ $campaigns[] = $banner['campaign'];
186186 }
187187 }
188188
189189 // Build campaign list for bannerstats.js
190 - $campaignList = implode( ', ', $campaigns );
191 - $js = "wgCentralNoticeAllocationCampaigns = array( $campaignList );";
 190+ $campaignList = json_encode( $campaigns );
 191+ $js = "wgCentralNoticeAllocationCampaigns = $campaignList;";
192192 $htmlOut .= Html::inlineScript( $js );
193193
194194 if ( $anonBanners && $anonWeight > 0 ) {
Index: trunk/extensions/CentralNotice/bannerstats.js
@@ -3,6 +3,7 @@
44 * wgCentralNoticeAllocationCampaigns. It then adds the rates to the allocation tables.
55 */
66 $( document ).ready( function () {
 7+ /*
78 $.each( wgCentralNoticeAllocationCampaigns, function( index, campaignName ) {
89 var statUrl = 'http://fundraising-analytics.wikimedia.org/live_stats/' + campaignName;
910 $.ajax( {
@@ -20,4 +21,5 @@
2122 }
2223 } );
2324 } )
 25+ */
2426 } );

Follow-up revisions

RevisionCommit summaryAuthorDate
r106866follow-up to r106849, using FormatJson::encode instead for backwards compatkaldari21:27, 20 December 2011
r107015MFT r103297, r104003, r104210, r104999, r105015, r105740, r105800, r106166, r...awjrichards23:56, 21 December 2011

Comments

#Comment by 😂 (talk | contribs)   20:12, 20 December 2011

Should use FormatJson::encode() wrapper instead.

#Comment by Kaldari (talk | contribs)   21:28, 20 December 2011

Oh yeah, I forgot about that bugger. Fixed in r106866.

Status & tagging log