From 1046a0916d3525ab672fe336b476d6509eac7170 Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 29 Jul 2013 14:13:56 -0400 Subject: [PATCH] CC-5289: Exception about linked show in zendphp.log --- .../application/services/SchedulerService.php | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/airtime_mvc/application/services/SchedulerService.php b/airtime_mvc/application/services/SchedulerService.php index 7ab662c5c..c1dd6fc1f 100644 --- a/airtime_mvc/application/services/SchedulerService.php +++ b/airtime_mvc/application/services/SchedulerService.php @@ -248,22 +248,24 @@ class Application_Service_SchedulerService } } //foreach linked instance - $insert_sql = "INSERT INTO cc_schedule (starts, ends, ". - "clip_length, fade_in, fade_out, cue_in, cue_out, ". - "file_id, stream_id, instance_id, position) VALUES ". - implode($values, ","); + if (!empty($values)) { + $insert_sql = "INSERT INTO cc_schedule (starts, ends, ". + "clip_length, fade_in, fade_out, cue_in, cue_out, ". + "file_id, stream_id, instance_id, position) VALUES ". + implode($values, ","); - Application_Common_Database::prepareAndExecute( - $insert_sql, array(), Application_Common_Database::EXECUTE); + Application_Common_Database::prepareAndExecute( + $insert_sql, array(), Application_Common_Database::EXECUTE); - //update time_filled in cc_show_instances - $now = gmdate("Y-m-d H:i:s"); - $update_sql = "UPDATE cc_show_instances SET ". - "time_filled = '{$timeFilled}', ". - "last_scheduled = '{$now}' ". - "WHERE show_id = {$ccShow->getDbId()}"; - Application_Common_Database::prepareAndExecute( - $update_sql, array(), Application_Common_Database::EXECUTE); + //update time_filled in cc_show_instances + $now = gmdate("Y-m-d H:i:s"); + $update_sql = "UPDATE cc_show_instances SET ". + "time_filled = '{$timeFilled}', ". + "last_scheduled = '{$now}' ". + "WHERE show_id = {$ccShow->getDbId()}"; + Application_Common_Database::prepareAndExecute( + $update_sql, array(), Application_Common_Database::EXECUTE); + } } //if at least one linked instance has content }