r76595 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76594‎ | r76595 | r76596 >
Date:20:50, 12 November 2010
Author:tparscal
Status:deferred (Comments)
Tags:
Comment:
Reverting lots of changes by Reedy that broke this extension pretty badly.
Modified paths:
  • /trunk/extensions/ContributionReporting/FundraiserStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContributionReporting/FundraiserStatistics_body.php
@@ -15,7 +15,7 @@
1616 }
1717
1818 public function execute( $sub ) {
19 - global $wgOut, $wgLang, $wgScriptPath, $egFundraiserStatisticsFundraisers;
 19+ global $wgRequest, $wgOut, $wgUser, $wgLang, $wgScriptPath, $egFundraiserStatisticsFundraisers;
2020
2121 /* Configuration (this isn't totally static data, some of it gets built on the fly) */
2222
@@ -78,7 +78,7 @@
7979
8080 // Chart maximums
8181 foreach ( $egFundraiserStatisticsFundraisers as $fundraiser ) {
82 - foreach ( $charts as $name ) {
 82+ foreach ( $charts as $name => $chart ) {
8383 $chartMax = $this->query( $charts[$name]['query'], $fundraiser['start'], $fundraiser['end'] );
8484 if ( $chartMax > $charts[$name]['max'] ) {
8585 $charts[$name]['max'] = $chartMax;
@@ -161,7 +161,7 @@
162162 // Tabs
163163 $first = true;
164164 $htmlCharts = Xml::openElement( 'div', array( 'class' => 'fundraiserstats-chart-tabs' ) );
165 - foreach ( $charts as $chart ) {
 165+ foreach ( $charts as $chart => $columns ) {
166166 $htmlCharts .= Xml::tags(
167167 'div',
168168 array(
@@ -244,7 +244,7 @@
245245 );
246246 $result = array();
247247 $ytd = 0;
248 - foreach ( $select as $row ) {
 248+ while ( $row = $dbr->fetchRow( $select ) ) {
249249 $row[] = $ytd += $row[1]; // YTD
250250 $result[] = $row;
251251 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r78421Merging r76595, r76598 of trunkawjrichards00:35, 15 December 2010

Comments

#Comment by Reedy (talk | contribs)   23:40, 12 November 2010

The changes of the original foreach loops I can see the errors.. I imagine the removal of globals and swap to foreach should've been fine though...

Status & tagging log