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
This commit is contained in:
denise 2013-10-01 14:19:02 -04:00
parent 3d9bc85fa0
commit 1e59ab836d
2 changed files with 9 additions and 1 deletions

View File

@ -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;
}

View File

@ -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;