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

Revision: 100319
Author:   reedy
Date:     2011-10-20 01:31:48 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
1.18wmf1 MFT r100314, r100316

Modified Paths:
--------------
    branches/wmf/1.18wmf1/extensions/Contest/Contest.php
    branches/wmf/1.18wmf1/extensions/Contest/api/ApiMailContestants.php
    branches/wmf/1.18wmf1/extensions/Contest/includes/ContestContestant.php
    branches/wmf/1.18wmf1/extensions/Contest/includes/ContestReminderJob.php

Property Changed:
----------------
    branches/wmf/1.18wmf1/extensions/Contest/


Property changes on: branches/wmf/1.18wmf1/extensions/Contest
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/extensions/Contest:51646
/branches/REL1_17/phase3/extensions/Contest:81445,81448
/branches/new-installer/phase3/extensions/Contest:43664-66004
/branches/sqlite/extensions/Contest:58211-58321
/trunk/extensions/Contest:99592,99653,100190-100191,100193,100198,100200,100240,100245,100251-100252,100255,100258-100259,100261,100274,100276,100278,100287,100292,100295,100302,100307-100309,100311
/trunk/phase3/extensions/Contest:92580,92634,92713,92762,92765,92791,92854,92884,92886-92887,92894,92898,92907,92932,92958,93141,93149,93151,93233-93234,93258,93266,93303,93516-93518,93520,93818-93822,93847,93858,93891,93935-93936,94058,94062,94068,94107,94155,94235,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94630,94728,94738,94825,94862,94995-94997,95023,95042,95072-95073,95155,95327,95332,95410,95422,95426,95442,95468,95601,95812,98578,98598,98656
   + /branches/REL1_15/phase3/extensions/Contest:51646
/branches/REL1_17/phase3/extensions/Contest:81445,81448
/branches/new-installer/phase3/extensions/Contest:43664-66004
/branches/sqlite/extensions/Contest:58211-58321
/trunk/extensions/Contest:99592,99653,100190-100191,100193,100198,100200,100240,100245,100251-100252,100255,100258-100259,100261,100274,100276,100278,100287,100292,100295,100302,100307-100309,100311,100314,100316
/trunk/phase3/extensions/Contest:92580,92634,92713,92762,92765,92791,92854,92884,92886-92887,92894,92898,92907,92932,92958,93141,93149,93151,93233-93234,93258,93266,93303,93516-93518,93520,93818-93822,93847,93858,93891,93935-93936,94058,94062,94068,94107,94155,94235,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94630,94728,94738,94825,94862,94995-94997,95023,95042,95072-95073,95155,95327,95332,95410,95422,95426,95442,95468,95601,95812,98578,98598,98656

Modified: branches/wmf/1.18wmf1/extensions/Contest/Contest.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/Contest.php        2011-10-20 
01:29:10 UTC (rev 100318)
+++ branches/wmf/1.18wmf1/extensions/Contest/Contest.php        2011-10-20 
01:31:48 UTC (rev 100319)
@@ -101,6 +101,9 @@
 $wgAPIListModules['contestcomments']                   = 
'ApiQueryContestComments';
 $wgAPIListModules['contests']                                  = 
'ApiQueryContests';
 
+// Jobs
+$wgJobClasses['ContestReminderJob']                    = 'ContestReminderJob';
+
 // Hooks
 $wgHooks['LoadExtensionSchemaUpdates'][]               = 
'ContestHooks::onSchemaUpdate';
 $wgHooks['UnitTestsList'][]                                    = 
'ContestHooks::registerUnitTests';

Modified: branches/wmf/1.18wmf1/extensions/Contest/api/ApiMailContestants.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/api/ApiMailContestants.php 
2011-10-20 01:29:10 UTC (rev 100318)
+++ branches/wmf/1.18wmf1/extensions/Contest/api/ApiMailContestants.php 
2011-10-20 01:31:48 UTC (rev 100319)
@@ -78,7 +78,7 @@
                        $limit = count( $contestants );
 
                        for ( $i = 0; $i <= $limit; $i += $setSize ) {
-                               $this->createReminderJob( array_splice( 
$contestants, $i, $setSize ) );
+                               $this->createReminderJob( array_slice( 
$contestants, $i, $setSize ) );
                        }
                }
                else {

Modified: 
branches/wmf/1.18wmf1/extensions/Contest/includes/ContestContestant.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/includes/ContestContestant.php     
2011-10-20 01:29:10 UTC (rev 100318)
+++ branches/wmf/1.18wmf1/extensions/Contest/includes/ContestContestant.php     
2011-10-20 01:31:48 UTC (rev 100319)
@@ -571,6 +571,15 @@
         */
        public function getUser() {
                if ( is_null( $this->user ) ) {
+                       if ( !$this->hasField( 'user_id' ) ) {
+                               if ( is_null( $this->getId() ) ) {
+                                       throw new MWException( 'Can not get an 
user object when the user_id field is not set.' );
+                               }
+                               else {
+                                       $this->loadFields( 'user_id' );
+                               }
+                       }
+                       
                        $this->user = User::newFromId( $this->getField( 
'user_id' ) );
                }
 

Modified: 
branches/wmf/1.18wmf1/extensions/Contest/includes/ContestReminderJob.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/includes/ContestReminderJob.php    
2011-10-20 01:29:10 UTC (rev 100318)
+++ branches/wmf/1.18wmf1/extensions/Contest/includes/ContestReminderJob.php    
2011-10-20 01:31:48 UTC (rev 100319)
@@ -22,8 +22,8 @@
         * * contest, Contest, required
         */
        public function __construct( Title $title, array $params ) {
-               parent::__construct( 'ContestReminderJob', $title, $params );
-               $this->params['emailText'] = 
ContestUtils::getParsedArticleContent( $this->params['reminder_email'] );
+               parent::__construct( __CLASS__, $title, $params );
+               $this->params['emailText'] = 
ContestUtils::getParsedArticleContent( $this->params['contest']->getField( 
'reminder_email' ) );
                $this->params['daysLeft'] = 
$this->params['contest']->getDaysLeft();
        }
 


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

Reply via email to