r99532 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99531‎ | r99532 | r99533 >
Date:18:41, 11 October 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
check if there are actually contestants
Modified paths:
  • /trunk/extensions/Contest/includes/Contest.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/includes/Contest.class.php
@@ -409,8 +409,11 @@
410410 $contestantIds[] = $contestant->getId();
411411 }
412412
413 - $success = ContestComment::s()->delete( array( 'contestant_id' => $contestantIds ) ) && $success;
414 - $success = ContestVote::s()->delete( array( 'contestant_id' => $contestantIds ) ) && $success;
 413+ if ( count( $contestantIds ) > 0 ) {
 414+ $success = ContestComment::s()->delete( array( 'contestant_id' => $contestantIds ) ) && $success;
 415+ $success = ContestVote::s()->delete( array( 'contestant_id' => $contestantIds ) ) && $success;
 416+ }
 417+
415418 $success = ContestContestant::s()->delete( $condition ) && $success;
416419 }
417420

Status & tagging log