http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100278
Revision: 100278
Author: jeroendedauw
Date: 2011-10-19 21:09:31 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
Follow up to r100245;
Modified Paths:
--------------
trunk/extensions/Contest/specials/SpecialMyContests.php
Modified: trunk/extensions/Contest/specials/SpecialMyContests.php
===================================================================
--- trunk/extensions/Contest/specials/SpecialMyContests.php 2011-10-19
20:57:02 UTC (rev 100277)
+++ trunk/extensions/Contest/specials/SpecialMyContests.php 2011-10-19
21:09:31 UTC (rev 100278)
@@ -76,7 +76,7 @@
/**
* @var $contest Contest
*/
- $contest = $contestants[0]->getContest( array(
'status', 'name' ) );
+ $contest = $contestants[0]->getContest( array(
'status', 'name' ) );
if ( $contest->getField( 'status' ) ==
Contest::STATUS_ACTIVE ) {
$this->getOutput()->redirect( $this->getTitle(
$contest->getField( 'name' ) )->getLocalURL() );
@@ -302,20 +302,15 @@
$form->setSubmitCallback( array( $this, 'handleSubmission' ) );
$form->setSubmitText( wfMsg( 'contest-submission-submit' ) );
- $challengeId = $contestant->getField( 'challenge_id' );
- $challenges = $contest->getChallenges();
-
/**
* @var $challenge ContestChallenge
*/
- $challenge = null;
- foreach( $challenges as $challenge ) {
- if ( $challenge->getId() == $challengeId ) {
- break;
- }
- }
+ $challenge = ContestChallenge::s()->selectRow(
+ array( 'title', 'text' ),
+ array( 'id' => $contestant->getField( 'challenge_id' ) )
+ );
- if ( $challenge !== null ) {
+ if ( $challenge !== false ) {
$challengeName = $challenge->getField( 'title' );
$challengeDescription = $challenge->getField( 'text' );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs