From: lucianov88 Date: Sat, 5 Mar 2016 02:53:13 +0000 (-0300) Subject: CRM-14097 ISSUE - Schedule Reminder UI X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=02fdbd865a515ce0e386107543d649b064dc7414;p=civicrm-core.git CRM-14097 ISSUE - Schedule Reminder UI Validation for email subject and email html message added , if it is checked the "Send Email" checkbox it will validate on form submisson to not get an empty subject or message. Also wont be possible to add a subject as " ", or empy html tags as message. --- diff --git a/CRM/Admin/Form/ScheduleReminders.php b/CRM/Admin/Form/ScheduleReminders.php index 61fca0e171..edc08e8931 100644 --- a/CRM/Admin/Form/ScheduleReminders.php +++ b/CRM/Admin/Form/ScheduleReminders.php @@ -309,11 +309,15 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { } 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.'); } + if (!empty($fields['is_active']) && + CRM_Utils_System::isNull(trim(strip_tags($fields['html_message']))) + ) { + $errors['html_message'] = ts('The HTML message is a required field.'); + } if (empty($self->_context) && CRM_Utils_System::isNull(CRM_Utils_Array::value(1, $fields['entity']))) { $errors['entity'] = ts('Please select entity value');