r43285 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43284‎ | r43285 | r43286 >
Date:22:25, 7 November 2008
Author:tparscal
Status:old (Comments)
Tags:
Comment:
Fixed array merging bug.
Modified paths:
  • /trunk/extensions/ContributionReporting/ContributionStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContributionReporting/ContributionStatistics_body.php
@@ -240,8 +240,11 @@
241241 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-percentage-ytd' ) );
242242 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-avg' ) );
243243
244 - $factor = $this->getNumContributions() > 0 ? 100.0 / $this->getNumContributions() : 0;
 244+ $numContributions = $this->getNumContributions();
 245+ $factor = $numContributions > 0 ? 100.0 / $numContributions : 0;
245246
 247+ $htmlOut .= $numContributions;
 248+
246249 $list = array(
247250 'Exactly 30.00' => array( 30 ),
248251 'Exactly 75.00' => array( 75 ),
@@ -384,15 +387,17 @@
385388 $dbr = efContributionReportingConnection();
386389
387390 // Return average contribution amount
 391+ $sizes = array(
 392+ 'converted_amount >= ' . $dbr->addQuotes( $min ),
 393+ 'converted_amount <= ' . $dbr->addQuotes( $max ),
 394+ );
 395+ $dates = $this->dateConds( $dbr );
388396 $res = $dbr->select( 'public_reporting',
389397 array(
390398 'count(*)',
391399 'avg(converted_amount)'
392400 ),
393 - array(
394 - 'converted_amount > ' . $dbr->addQuotes( $min ),
395 - 'converted_amount < ' . $dbr->addQuotes( $max ),
396 - ) + $this->dateConds( $dbr ),
 401+ array_merge( $sizes, $dates ),
397402 __METHOD__
398403 );
399404

Comments

#Comment by Brion VIBBER (talk | contribs)   22:26, 7 November 2008

debug code removed in next commit :D

Status & tagging log