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

Revision: 100320
Author:   jeroendedauw
Date:     2011-10-20 01:46:29 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
override toString method since the base class one does not handle objects in 
the params field, so goes mad when jobs are run via MediaWiki::doJobs

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

Modified: trunk/extensions/Contest/includes/ContestDBObject.php
===================================================================
--- trunk/extensions/Contest/includes/ContestDBObject.php       2011-10-20 
01:31:48 UTC (rev 100319)
+++ trunk/extensions/Contest/includes/ContestDBObject.php       2011-10-20 
01:46:29 UTC (rev 100320)
@@ -332,7 +332,7 @@
        }
 
        /**
-        * Return the names of the fields.
+        * Return the names and values of the fields.
         *
         * @since 0.1
         *

Modified: trunk/extensions/Contest/includes/ContestReminderJob.php
===================================================================
--- trunk/extensions/Contest/includes/ContestReminderJob.php    2011-10-20 
01:31:48 UTC (rev 100319)
+++ trunk/extensions/Contest/includes/ContestReminderJob.php    2011-10-20 
01:46:29 UTC (rev 100320)
@@ -44,5 +44,20 @@
 
                return true;
        }
+       
+       function toString() {
+               $stringContestants = array();
+               
+               /**
+                * @var $contestant ContestContestant
+                */
+               foreach ( $this->params['contestants'] as /* ContestContestant 
*/ $contestant ) {
+                       $stringContestants[] = FormatJson::encode( 
$contestant->getFields() );
+               }
+               
+               return 'Contest reminder email for contest '
+                       . $this->params['contest']->getId()
+                       . ' for these ' . count( $this->params['contestants'] ) 
. ' contestants: ' . implode( ', ', $stringContestants ) . '.';
+       }
 
 }


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

Reply via email to