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:
parent
1b3a9f6e6a
commit
721cd5a31b
1 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue