Merge pull request #11947 from eileenmcnaughton/dev_tab
[civicrm-core.git] / CRM / Mailing / BAO / MailingJob.php
index 3fe82a511b76a2ec455f10718f572eeb4671846e..d86815a7a4a4d3a68adffa2d4005eadd9a6cb2f8 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017                                |
+ | Copyright CiviCRM LLC (c) 2004-2018                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2017
+ * @copyright CiviCRM LLC (c) 2004-2018
  */
 
 require_once 'Mail.php';
@@ -375,11 +375,11 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
         continue;
       }
 
+      $transaction = new CRM_Core_Transaction();
+
       $job->split_job($offset);
 
       // update the status of the parent job
-      $transaction = new CRM_Core_Transaction();
-
       $saveJob = new CRM_Mailing_DAO_MailingJob();
       $saveJob->id = $job->id;
       $saveJob->start_date = date('YmdHis');
@@ -437,6 +437,7 @@ VALUES (%1, %2, %3, %4, %5, %6, %7)
         CRM_Core_DAO::executeQuery($sql, $params);
       }
     }
+
   }
 
   /**