From 6c8ae5bf622bf8efe551335f388c2e332eab4af4 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Thu, 4 Jun 2020 11:15:15 +0100 Subject: [PATCH] set boolean fields to false if not set. --- CRM/Admin/Form/ScheduleReminders.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CRM/Admin/Form/ScheduleReminders.php b/CRM/Admin/Form/ScheduleReminders.php index a7b94e70f411..c881ef779387 100644 --- a/CRM/Admin/Form/ScheduleReminders.php +++ b/CRM/Admin/Form/ScheduleReminders.php @@ -481,7 +481,6 @@ public function parseActionSchedule($values) { 'subject', 'absolute_date', 'group_id', - 'record_activity', 'limit_to', 'mode', 'sms_provider_id', @@ -492,7 +491,10 @@ public function parseActionSchedule($values) { $params[$key] = $values[$key] ?? NULL; } - $params['is_repeat'] = CRM_Utils_Array::value('is_repeat', $values, 0); + // set boolean fields to false if not set. + foreach (['record_activity', 'is_repeat', 'is_active'] as $boolFieldName) { + $params[$boolFieldName] = $values[$boolFieldName] ?? 0; + } $moreKeys = [ 'start_action_offset', @@ -559,8 +561,6 @@ public function parseActionSchedule($values) { $params['entity_status'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, $entity_status); } - $params['is_active'] = CRM_Utils_Array::value('is_active', $values, 0); - if (empty($values['is_repeat'])) { $params['repetition_frequency_unit'] = 'null'; $params['repetition_frequency_interval'] = 'null';