CRM-15678 don't record reminder send activity if not sent
authorEileen McNaughton <eileen@fuzion.co.nz>
Wed, 3 Dec 2014 00:18:22 +0000 (13:18 +1300)
committerCiviCRM <info@civicrm.org>
Thu, 4 Dec 2014 10:48:40 +0000 (16:18 +0530)
CRM/Core/BAO/ActionSchedule.php

index 45bd673f8d605746f1e7d694431e899405e53575..b3a33e2dbefaa57f9b88c533b585c5e4193a279a 100755 (executable)
@@ -875,7 +875,7 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL
         CRM_Core_BAO_ActionLog::create($logParams);
 
         // insert activity log record if needed
-        if ($actionSchedule->record_activity) {
+        if ($actionSchedule->record_activity && !$isError) {
           $activityParams = array(
             'subject' => $actionSchedule->title,
             'details' => $actionSchedule->body_html,
@@ -887,7 +887,7 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL
             'activity_type_id' => $activityTypeID,
             'source_record_id' => $dao->entityID,
           );
-          $activity = CRM_Activity_BAO_Activity::create($activityParams);
+          CRM_Activity_BAO_Activity::create($activityParams);
         }
       }