From 721cd5a31bbfdbc880c07d7caa4c05f0f5f9c43d Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 13 Jul 2015 09:04:49 -0400 Subject: [PATCH] SAAS-924: Cannot edit repeating show if first instance has ended Added safeguard in case we don't find a future show instance --- airtime_mvc/application/services/ShowFormService.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/services/ShowFormService.php b/airtime_mvc/application/services/ShowFormService.php index 24c66e3ef..8af6a78fa 100644 --- a/airtime_mvc/application/services/ShowFormService.php +++ b/airtime_mvc/application/services/ShowFormService.php @@ -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)