Index: trunk/extensions/Contest/specials/SpecialMyContests.php |
— | — | @@ -76,7 +76,7 @@ |
77 | 77 | /** |
78 | 78 | * @var $contest Contest |
79 | 79 | */ |
80 | | - $contest = $contestants[0]->getContest( array( 'status', 'name' ) ); |
| 80 | + $contest = $contestants[0]->getContest( array( 'status', 'name' ) ); |
81 | 81 | |
82 | 82 | if ( $contest->getField( 'status' ) == Contest::STATUS_ACTIVE ) { |
83 | 83 | $this->getOutput()->redirect( $this->getTitle( $contest->getField( 'name' ) )->getLocalURL() ); |
— | — | @@ -302,20 +302,15 @@ |
303 | 303 | $form->setSubmitCallback( array( $this, 'handleSubmission' ) ); |
304 | 304 | $form->setSubmitText( wfMsg( 'contest-submission-submit' ) ); |
305 | 305 | |
306 | | - $challengeId = $contestant->getField( 'challenge_id' ); |
307 | | - $challenges = $contest->getChallenges(); |
308 | | - |
309 | 306 | /** |
310 | 307 | * @var $challenge ContestChallenge |
311 | 308 | */ |
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 | + ); |
318 | 313 | |
319 | | - if ( $challenge !== null ) { |
| 314 | + if ( $challenge !== false ) { |
320 | 315 | $challengeName = $challenge->getField( 'title' ); |
321 | 316 | $challengeDescription = $challenge->getField( 'text' ); |
322 | 317 | |