CC-2179: Creating a record + rebroadcast show with no rebroadcast times causes DB error

-fixed
This commit is contained in:
martin 2011-04-14 14:57:52 -04:00
parent 5a7ebc8a8b
commit 88362a2c52
2 changed files with 24 additions and 12 deletions

View File

@ -38,10 +38,16 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
$day = $formData['add_show_rebroadcast_date_absolute_'.$i];
if($day == "") {
if(trim($day) == "") {
continue;
}
$time = $formData['add_show_rebroadcast_time_absolute_'.$i];
if (trim($time) == ""){
$this->getElement('add_show_rebroadcast_time_absolute_'.$i)->setErrors(array("Time must be specified"));
$valid = false;
}
$show_start_time = $formData['add_show_start_date']."".$formData['add_show_start_time'];
$show_end = new DateTime($show_start_time);

View File

@ -43,10 +43,16 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
$days = $formData['add_show_rebroadcast_date_'.$i];
if($days == "") {
if(trim($days) == "") {
continue;
}
$time = $formData['add_show_rebroadcast_time_'.$i];
if (trim($time) == ""){
$this->getElement('add_show_rebroadcast_time_'.$i)->setErrors(array("Time must be specified"));
$valid = false;
}
$days = explode(" ", $days);
$day = $days[0];