From 50d35b632abc51adac37e798b8745b19df38d81e Mon Sep 17 00:00:00 2001 From: larssandergreen Date: Fri, 30 Sep 2022 15:12:57 -0600 Subject: [PATCH] Add error if both absolute and relative date entered --- CRM/Admin/Form/ScheduleReminders.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CRM/Admin/Form/ScheduleReminders.php b/CRM/Admin/Form/ScheduleReminders.php index 303285de313f..25a8b57baba6 100644 --- a/CRM/Admin/Form/ScheduleReminders.php +++ b/CRM/Admin/Form/ScheduleReminders.php @@ -333,6 +333,9 @@ public static function formRule(array $fields, $files, $self) { $errors['entity'] = ts('Please select entity value'); } + if (!CRM_Utils_System::isNull($fields['absolute_date']) && !CRM_Utils_System::isNull($fields['start_action_offset'])) { + $errors['absolute_date'] = ts('Only an absolute date or a relative date or time can be entered, not both.'); + } if (!CRM_Utils_System::isNull($fields['absolute_date'])) { if ($fields['absolute_date'] < date('Y-m-d')) { $errors['absolute_date'] = ts('Absolute date cannot be earlier than the current time.');