diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 7b817dcad..610449714 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -655,15 +655,16 @@ SQL; ->filterByDbDay($dayOfWeek) ->findOne(); - $lastShowStartDT->setTimeZone(new DateTimeZone( - $ccShowDay->getDbTimezone())); - $lastShowEndDT = Application_Service_CalendarService::addDeltas( - $lastShowStartDT, 1, 0); + if (isset($ccShowDay)) { + $lastShowStartDT->setTimeZone(new DateTimeZone( + $ccShowDay->getDbTimezone())); + $lastShowEndDT = Application_Service_CalendarService::addDeltas( + $lastShowStartDT, 1, 0); - $ccShowDay - ->setDbLastShow($lastShowEndDT->format("Y-m-d")) - ->save(); - + $ccShowDay + ->setDbLastShow($lastShowEndDT->format("Y-m-d")) + ->save(); + } } //remove the old repeating deleted instances. @@ -872,6 +873,7 @@ SQL; private function createWeeklyRepeatInstances($showDay, $populateUntil, $repeatType, $repeatInterval, $daysAdded=null) { + $show_id = $showDay->getDbShowId(); $first_show = $showDay->getDbFirstShow(); //non-UTC $last_show = $showDay->getDbLastShow(); //non-UTC @@ -896,7 +898,6 @@ SQL; $previousDate = clone $start; foreach ($datePeriod as $date) { - list($utcStartDateTime, $utcEndDateTime) = $this->createUTCStartEndDateTime( $date, $duration); /*