From 08e82cb32e697ad589b6cf4d18951df3212e44a7 Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 18 Aug 2014 19:27:42 -0400 Subject: [PATCH] CC-5904: New linked show instances may get an old copy of the schedule Change the way get the show stamp --- airtime_mvc/application/services/SchedulerService.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/services/SchedulerService.php b/airtime_mvc/application/services/SchedulerService.php index b39f491ed..c5dfe1fdc 100644 --- a/airtime_mvc/application/services/SchedulerService.php +++ b/airtime_mvc/application/services/SchedulerService.php @@ -199,8 +199,10 @@ class Application_Service_SchedulerService * sorted the instances by desc order, we are using the most recent * instance, which will have the most up to date schedule. */ + $showsPopulatedUntil = Application_Model_Preference::GetShowsPopulatedUntil(); + $showStamp_sql = "SELECT * FROM cc_schedule ". - "WHERE instance_id = $mostRecentInstanceId ". + "WHERE starts < '{$showsPopulatedUntil->format('Y-m-d H:i:s')}' ". "ORDER BY starts"; $showStamp = Application_Common_Database::prepareAndExecute( $showStamp_sql); @@ -232,7 +234,7 @@ class Application_Service_SchedulerService if (count($showInstanceContents) < 1 || self::replaceInstanceContentCheck($showInstanceContents, $showStamp, $id)) { - +Logging::info($showStamp_sql); $instanceStart_sql = "SELECT starts FROM cc_show_instances ". "WHERE id = {$id} ". "ORDER BY starts";