From f5710006574134966fbb5402c4c9db9d53da431b Mon Sep 17 00:00:00 2001 From: drigato Date: Tue, 26 Nov 2013 12:32:05 -0500 Subject: [PATCH] Fixed updating single show instance problem where it wasn't fetching the current instance --- 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 c347f6e68..303236e9f 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -896,7 +896,13 @@ SQL; if ($utcStartDateTime->getTimestamp() < $populateUntil->getTimestamp()) { $ccShowInstance = new CcShowInstances(); if ($this->isUpdate) { - $ccShowInstance = $this->getInstance($utcStartDateTime); + //use original cc_show_day object to get the current cc_show_instance + $origStartDateTime = new DateTime( + $this->origCcShowDay->getDbFirstShow()." ".$this->origCcShowDay->getDbStartTime(), + new DateTimeZone($this->origCcShowDay->getDbTimezone()) + ); + $origStartDateTime->setTimezone(new DateTimeZone("UTC")); + $ccShowInstance = $this->getInstance($origStartDateTime); } $ccShowInstance->setDbShowId($this->ccShow->getDbId());