X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FAdmin%2FForm%2FScheduleReminders.php;h=2c59e0c0326f2d6a84608ac6728000988b5b5b78;hb=780c8f48c69ad81040949dab1ddb58240b97315b;hp=152d5ae1859372be103629a0a0fb35bb16455ef2;hpb=43cbbe29eae642e90bc1b98a49d15ab8c415b3e9;p=civicrm-core.git diff --git a/CRM/Admin/Form/ScheduleReminders.php b/CRM/Admin/Form/ScheduleReminders.php index 152d5ae185..2c59e0c032 100644 --- a/CRM/Admin/Form/ScheduleReminders.php +++ b/CRM/Admin/Form/ScheduleReminders.php @@ -370,10 +370,10 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { $errors['is_repeat'] = ts('If you are enabling repetition you must indicate the frequency and ending term.'); } - $actionSchedule = $self->parseActionSchedule($fields); - if ($actionSchedule->mapping_id) { - $mapping = CRM_Core_BAO_ActionSchedule::getMapping($actionSchedule->mapping_id); - CRM_Utils_Array::extend($errors, $mapping->validateSchedule($actionSchedule)); + $self->_actionSchedule = $self->parseActionSchedule($fields); + if ($self->_actionSchedule->mapping_id) { + $mapping = CRM_Core_BAO_ActionSchedule::getMapping($self->_actionSchedule->mapping_id); + CRM_Utils_Array::extend($errors, $mapping->validateSchedule($self->_actionSchedule)); } if (!empty($errors)) { @@ -452,7 +452,12 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { return; } $values = $this->controller->exportValues($this->getName()); - $bao = $this->parseActionSchedule($values)->save(); + if (empty($this->_actionSchedule)) { + $bao = $this->parseActionSchedule($values)->save(); + } + else { + $bao = $this->_actionSchedule->save(); + } // we need to set this on the form so that hooks can identify the created entity $this->set('id', $bao->id);