Index: branches/wmf/1.18wmf1/extensions/Contest/Contest.php |
— | — | @@ -101,6 +101,9 @@ |
102 | 102 | $wgAPIListModules['contestcomments'] = 'ApiQueryContestComments'; |
103 | 103 | $wgAPIListModules['contests'] = 'ApiQueryContests'; |
104 | 104 | |
| 105 | +// Jobs |
| 106 | +$wgJobClasses['ContestReminderJob'] = 'ContestReminderJob'; |
| 107 | + |
105 | 108 | // Hooks |
106 | 109 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'ContestHooks::onSchemaUpdate'; |
107 | 110 | $wgHooks['UnitTestsList'][] = 'ContestHooks::registerUnitTests'; |
Index: branches/wmf/1.18wmf1/extensions/Contest/includes/ContestReminderJob.php |
— | — | @@ -22,8 +22,8 @@ |
23 | 23 | * * contest, Contest, required |
24 | 24 | */ |
25 | 25 | public function __construct( Title $title, array $params ) { |
26 | | - parent::__construct( 'ContestReminderJob', $title, $params ); |
27 | | - $this->params['emailText'] = ContestUtils::getParsedArticleContent( $this->params['reminder_email'] ); |
| 26 | + parent::__construct( __CLASS__, $title, $params ); |
| 27 | + $this->params['emailText'] = ContestUtils::getParsedArticleContent( $this->params['contest']->getField( 'reminder_email' ) ); |
28 | 28 | $this->params['daysLeft'] = $this->params['contest']->getDaysLeft(); |
29 | 29 | } |
30 | 30 | |
Index: branches/wmf/1.18wmf1/extensions/Contest/includes/ContestContestant.php |
— | — | @@ -571,6 +571,15 @@ |
572 | 572 | */ |
573 | 573 | public function getUser() { |
574 | 574 | if ( is_null( $this->user ) ) { |
| 575 | + if ( !$this->hasField( 'user_id' ) ) { |
| 576 | + if ( is_null( $this->getId() ) ) { |
| 577 | + throw new MWException( 'Can not get an user object when the user_id field is not set.' ); |
| 578 | + } |
| 579 | + else { |
| 580 | + $this->loadFields( 'user_id' ); |
| 581 | + } |
| 582 | + } |
| 583 | + |
575 | 584 | $this->user = User::newFromId( $this->getField( 'user_id' ) ); |
576 | 585 | } |
577 | 586 | |
Index: branches/wmf/1.18wmf1/extensions/Contest/api/ApiMailContestants.php |
— | — | @@ -78,7 +78,7 @@ |
79 | 79 | $limit = count( $contestants ); |
80 | 80 | |
81 | 81 | for ( $i = 0; $i <= $limit; $i += $setSize ) { |
82 | | - $this->createReminderJob( array_splice( $contestants, $i, $setSize ) ); |
| 82 | + $this->createReminderJob( array_slice( $contestants, $i, $setSize ) ); |
83 | 83 | } |
84 | 84 | } |
85 | 85 | else { |
Property changes on: branches/wmf/1.18wmf1/extensions/Contest |
___________________________________________________________________ |
Modified: svn:mergeinfo |
86 | 86 | Merged /trunk/extensions/Contest:r100314,100316 |