From fb90d6bbc02e67e8e687429c488bc8a4a681ccb4 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Fri, 23 Jan 2015 17:13:50 +0530 Subject: [PATCH] CRM-15536 fix - Scheduled reminders: Clarify "Limit to" and "Also include" UI to prevent user errors https://issues.civicrm.org/jira/browse/CRM-15536 --- CRM/Admin/Form/ScheduleReminders.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Admin/Form/ScheduleReminders.php b/CRM/Admin/Form/ScheduleReminders.php index f83e3d4ee2..c37b020ab7 100644 --- a/CRM/Admin/Form/ScheduleReminders.php +++ b/CRM/Admin/Form/ScheduleReminders.php @@ -287,7 +287,8 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { } } - if (!empty($fields['is_active']) && $fields['mode'] != 'SMS' && + if (!empty($fields['is_active']) && + CRM_Utils_Array::value('mode', $fields) == 'SMS' && CRM_Utils_System::isNull($fields['subject']) ) { $errors['subject'] = ts('Subject is a required field.'); @@ -313,7 +314,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { 'target_id' => 'recipient_manual_id', ), ); - if (!empty($fields['limit_to']) && array_key_exists($fields['recipient'], $recipientKind) && empty($fields[$recipientKind[$fields['recipient']]['target_id']])) { + if ($fields['limit_to'] != '' && array_key_exists($fields['recipient'], $recipientKind) && empty($fields[$recipientKind[$fields['recipient']]['target_id']])) { $errors[$recipientKind[$fields['recipient']]['target_id']] = ts('If "Also include" or "Limit to" are selected, you must specify at least one %1', array(1 => $recipientKind[$fields['recipient']]['name'])); } -- 2.25.1