From 1e59ab836d14a2b79d300100e9a0a7e2b4480e33 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 1 Oct 2013 14:19:02 -0400 Subject: [PATCH] CC-5277: Selecting weekly repeat without selecting days fails silently - added a check in the 'when' form since the validation there relies on the repeat form being valid - added validation for this in the 'repeat' form --- airtime_mvc/application/forms/AddShowRepeats.php | 4 ++++ airtime_mvc/application/forms/AddShowWhen.php | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/forms/AddShowRepeats.php b/airtime_mvc/application/forms/AddShowRepeats.php index d09b5284a..814102878 100644 --- a/airtime_mvc/application/forms/AddShowRepeats.php +++ b/airtime_mvc/application/forms/AddShowRepeats.php @@ -104,6 +104,10 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm } } + if (!isset($formData['add_show_day_check'])) { + $this->getElement('add_show_day_check')->setErrors(array(_('Please select a repeat day'))); + } + return true; } diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index 3ca08b99e..62b8004c5 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -211,13 +211,17 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm $overlapping = Application_Model_Schedule::checkOverlappingShows( $show_start, $show_end); } - //$overlapping = Application_Model_Schedule::checkOverlappingShows($show_start, $show_end, $update, $instanceId); /* Check if repeats overlap with previously scheduled shows * Do this for each show day */ if (!$overlapping) { $startDow = date("w", $show_start->getTimestamp()); + + if (!isset($formData['add_show_day_check'])) { + return false; + } + foreach ($formData["add_show_day_check"] as $day) { $repeatShowStart = clone $show_start; $repeatShowEnd = clone $show_end;