SAAS-924: Cannot edit repeating show if first instance has ended

Added safeguard in case we don't find a future show instance
This commit is contained in:
drigato 2015-07-13 09:04:49 -04:00
parent 1b3a9f6e6a
commit 721cd5a31b

View file

@ -158,7 +158,11 @@ class Application_Service_ShowFormService
if (!$ccShowDay->isRepeating()) {
$form->disableStartDateAndTime();
} else {
list($showStart, $showEnd) = $this->getNextFutureRepeatShowTime();
$showStartAndEnd = $this->getNextFutureRepeatShowTime();
if (!is_null($showStartAndEnd)) {
$showStart = $showStartAndEnd["starts"];
$showEnd = $showStartAndEnd["ends"];
}
if ($this->hasShowStarted($showStart)) {
$form->disableStartDateAndTime();
}
@ -198,7 +202,7 @@ class Application_Service_ShowFormService
$starts->setTimezone(new DateTimeZone($showTimezone));
$ends->setTimezone(new DateTimeZone($showTimezone));
return array($starts, $ends);
return array("starts" => $starts, "ends" => $ends);
}
private function populateInstanceFormWhen($form)