r100278 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100277‎ | r100278 | r100279 >
Date:21:09, 19 October 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
Follow up to r100245;
Modified paths:
  • /trunk/extensions/Contest/specials/SpecialMyContests.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/specials/SpecialMyContests.php
@@ -76,7 +76,7 @@
7777 /**
7878 * @var $contest Contest
7979 */
80 - $contest = $contestants[0]->getContest( array( 'status', 'name' ) );
 80+ $contest = $contestants[0]->getContest( array( 'status', 'name' ) );
8181
8282 if ( $contest->getField( 'status' ) == Contest::STATUS_ACTIVE ) {
8383 $this->getOutput()->redirect( $this->getTitle( $contest->getField( 'name' ) )->getLocalURL() );
@@ -302,20 +302,15 @@
303303 $form->setSubmitCallback( array( $this, 'handleSubmission' ) );
304304 $form->setSubmitText( wfMsg( 'contest-submission-submit' ) );
305305
306 - $challengeId = $contestant->getField( 'challenge_id' );
307 - $challenges = $contest->getChallenges();
308 -
309306 /**
310307 * @var $challenge ContestChallenge
311308 */
312 - $challenge = null;
313 - foreach( $challenges as $challenge ) {
314 - if ( $challenge->getId() == $challengeId ) {
315 - break;
316 - }
317 - }
 309+ $challenge = ContestChallenge::s()->selectRow(
 310+ array( 'title', 'text' ),
 311+ array( 'id' => $contestant->getField( 'challenge_id' ) )
 312+ );
318313
319 - if ( $challenge !== null ) {
 314+ if ( $challenge !== false ) {
320315 $challengeName = $challenge->getField( 'title' );
321316 $challengeDescription = $challenge->getField( 'text' );
322317

Follow-up revisions

RevisionCommit summaryAuthorDate
r1002971.18wmf1 MFT r100251, r100255, r100258, r100259, r100274, r100276, r100278reedy23:52, 19 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100245Add a message telling the user the long description of the challenge they are...reedy17:48, 19 October 2011

Status & tagging log