From ded8ceb86b0521833862b6e96a8d39b7689daf59 Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 1 May 2013 14:40:33 -0400 Subject: [PATCH] CC-5082: Repeating shows "disappear" when switching calendar to next month We were trying to call a function on an object that was not set --- airtime_mvc/application/services/ShowService.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index b5806a638..fc1d0ec11 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -778,6 +778,12 @@ SQL; */ private function createNonRepeatingInstance($showDay, $populateUntil) { + if (isset($this->ccShow)) { + $showId = $this->ccShow->getDbId(); + } else { + $showId = $showDay["show_id"]; + } + //DateTime object $start = $showDay->getLocalStartDateAndTime(); @@ -789,7 +795,7 @@ SQL; if ($this->isUpdate) { $ccShowInstance = $this->getInstance($utcStartDateTime); } - $ccShowInstance->setDbShowId($this->ccShow->getDbId()); + $ccShowInstance->setDbShowId($showId); $ccShowInstance->setDbStarts($utcStartDateTime); $ccShowInstance->setDbEnds($utcEndDateTime); $ccShowInstance->setDbRecord($showDay->getDbRecord());