From 753003639f5284785fd58f589866ce1bea7a4681 Mon Sep 17 00:00:00 2001 From: drigato Date: Tue, 25 Feb 2014 17:22:17 -0500 Subject: [PATCH] CC-5696: Two shows or even three shows playing at once. Unstopable even after reboot The problem was that we weren't updating the first show's start time if deleting a repeat show day changes it. This affected the difference between the original show start time and the new one. --- airtime_mvc/application/models/airtime/CcShow.php | 3 +++ airtime_mvc/application/services/ShowService.php | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/airtime_mvc/application/models/airtime/CcShow.php b/airtime_mvc/application/models/airtime/CcShow.php index 91874eed6..59da9b35a 100644 --- a/airtime_mvc/application/models/airtime/CcShow.php +++ b/airtime_mvc/application/models/airtime/CcShow.php @@ -47,6 +47,9 @@ class CcShow extends BaseCcShow { */ public function getFirstCcShowDay($criteria = null, PropelPDO $con = null) { + CcShowPeer::clearInstancePool(); + CcShowPeer::clearRelatedInstancePool(); + if(null === $this->collCcShowDayss || null !== $criteria) { if ($this->isNew() && null === $this->collCcShowDayss) { // return empty collection diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index b4c31a676..afb630f9d 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -220,6 +220,13 @@ class Application_Service_ShowService $this->delegateInstanceCreation($daysAdded); if ($this->isUpdate) { + /* Set the show's start date to the start date of the first instance. + * We need to do this so we get the correct time diff for + * updating show content. CC-5696 + */ + $showData["add_show_start_date"] = $this->ccShow->getFirstCcShowDay()->getDbFirstShow(); + $showData["add_show_start_time"] = $this->ccShow->getFirstCcShowDay()->getDbStartTime(); + $this->adjustSchedule($showData); }