r100309 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100308‎ | r100309 | r100310 >
Date:00:57, 20 October 2011
Author:reedy
Status:ok
Tags:
Comment:
array_splice first parameter is passed by reference

This means, on every splice, items are removed from the contestant array

This fixes the contestant count
Modified paths:
  • /trunk/extensions/Contest/api/ApiMailContestants.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/api/ApiMailContestants.php
@@ -72,7 +72,8 @@
7373
7474 $contestants = ContestContestant::s()->select( array( 'id', 'user_id', 'contest_id', 'email' ), $conditions );
7575
76 - if ( $contestants !== false && count( $contestants ) > 0 ) {
 76+ $contestantCount = count( $contestants );
 77+ if ( $contestants !== false && $contestantCount > 0 ) {
7778 $setSize = ContestSettings::get( 'reminderJobSize' );
7879 $limit = count( $contestants );
7980
@@ -94,7 +95,7 @@
9596 $this->getResult()->addValue(
9697 null,
9798 'contestantcount',
98 - count( $contestants )
 99+ $contestantCount
99100 );
100101 }
101102 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r1003131.18wmf1 MFT r100295, r100302, r100307, r100308, r100309, r100311reedy01:03, 20 October 2011

Status & tagging log