Index: trunk/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: trunk/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 { |