http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100308

Revision: 100308
Author:   reedy
Date:     2011-10-20 00:50:22 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
Grab id and user_id of a user (prevents fatal on job execution)

Add some documentation

Modified Paths:
--------------
    trunk/extensions/Contest/api/ApiMailContestants.php
    trunk/extensions/Contest/includes/ContestReminderJob.php

Modified: trunk/extensions/Contest/api/ApiMailContestants.php
===================================================================
--- trunk/extensions/Contest/api/ApiMailContestants.php 2011-10-20 00:47:53 UTC 
(rev 100307)
+++ trunk/extensions/Contest/api/ApiMailContestants.php 2011-10-20 00:50:22 UTC 
(rev 100308)
@@ -70,7 +70,7 @@
                        $conditions['id'] = $params['ids'];
                }
 
-               $contestants = ContestContestant::s()->select( array( 
'contest_id', 'email' ), $conditions );
+               $contestants = ContestContestant::s()->select( array( 'id', 
'user_id', 'contest_id', 'email' ), $conditions );
 
                if ( $contestants !== false && count( $contestants ) > 0 ) {
                        $setSize = ContestSettings::get( 'reminderJobSize' );
@@ -169,7 +169,7 @@
        public function getDescription() {
                return array(
                        'API module for mailing contestants. Selection criteria 
will be joined with AND,
-                       except for the challange ids/titles and contest 
ids/names pairs, which will be joined wit OR.'
+                       except for the challange ids/titles and contest 
ids/names pairs, which will be joined with OR.'
                );
        }
 
@@ -184,7 +184,7 @@
                        'api.php?action=mailcontestants&ids=42',
                        'api.php?action=mailcontestants&ids=4|2',
                        'api.php?action=mailcontestants&contestids=42',
-                       'api.php?action=mailcontestants&contestnames=Weekend of 
Code',
+                       
'api.php?action=mailcontestants&contestnames=Weekend_of_Code',
                        
'api.php?action=mailcontestants&challengetitles=foo|bar|baz',
                );
        }

Modified: trunk/extensions/Contest/includes/ContestReminderJob.php
===================================================================
--- trunk/extensions/Contest/includes/ContestReminderJob.php    2011-10-20 
00:47:53 UTC (rev 100307)
+++ trunk/extensions/Contest/includes/ContestReminderJob.php    2011-10-20 
00:50:22 UTC (rev 100308)
@@ -33,6 +33,9 @@
         * @return bool
         */
        public function run() {
+               /**
+                * @var $contestant ContestContestant
+                */
                foreach ( $this->params['contestants'] as /* ContestContestant 
*/ $contestant ) {
                        $contestant->sendReminderEmail( 
$this->params['emailText'], array(
                                'daysLeft' => $this->params['daysLeft'],


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to