From 09754b20cc52f0c308f4fc313fe7d9d5dcf82994 Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 1 May 2013 15:20:55 -0400 Subject: [PATCH] CC-5082: Repeating shows "disappear" when switching calendar to next month This was caused by the calendar trying to re-create single instance shows. We needed to exclude non-repeating shows when populating the calendar with repeat events --- airtime_mvc/application/services/ShowService.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index c15b49d7d..103f0a7f9 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -230,6 +230,7 @@ class Application_Service_ShowService $c = new Criteria(); $c->add(CcShowDaysPeer::FIRST_SHOW, $endTimeString, Criteria::LESS_THAN); $c->addAnd(CcShowDaysPeer::LAST_SHOW, $startTimeString, Criteria::GREATER_THAN); + $c->addAnd(CcShowDaysPeer::REPEAT_TYPE, -1, Criteria::NOT_EQUAL); $c->addOr(CcShowDaysPeer::LAST_SHOW, null, Criteria::ISNULL); return CcShowDaysPeer::doSelect($c); @@ -778,12 +779,6 @@ SQL; */ private function createNonRepeatingInstance($showDay, $populateUntil) { - if (isset($this->ccShow)) { - $showId = $this->ccShow->getDbId(); - } else { - $showId = $showDay->getDbShowId(); - } - //DateTime object $start = $showDay->getLocalStartDateAndTime(); @@ -795,7 +790,8 @@ SQL; if ($this->isUpdate) { $ccShowInstance = $this->getInstance($utcStartDateTime); } - $ccShowInstance->setDbShowId($showId); + + $ccShowInstance->setDbShowId($this->ccShow->getDbId()); $ccShowInstance->setDbStarts($utcStartDateTime); $ccShowInstance->setDbEnds($utcEndDateTime); $ccShowInstance->setDbRecord($showDay->getDbRecord());