From c18d53f403175b45833bd9211d303a78ce091589 Mon Sep 17 00:00:00 2001 From: drigato Date: Tue, 3 Dec 2013 15:07:40 -0500 Subject: [PATCH] CC-5593: Overlapping Show Bug Get instance depending on whether instance id is provided or not --- airtime_mvc/application/models/Schedule.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 3d82756ba..80a26ba75 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -1282,10 +1282,16 @@ SQL; $update=false, $instanceId=null, $showId=null) { //if the show instance does not exist or was deleted, return false - $ccShowInstance = CcShowInstancesQuery::create() - ->filterByDbShowId($showId) - ->filterByDbStarts($show_start->format("Y-m-d H:i:s")) - ->findOne(); + if (!is_null($showId)) { + $ccShowInstance = CcShowInstancesQuery::create() + ->filterByDbShowId($showId) + ->filterByDbStarts($show_start->format("Y-m-d H:i:s")) + ->findOne(); + } elseif (!is_null($instanceId)) { + $ccShowInstance = CcShowInstancesQuery::create() + ->filterByDbId($instanceId) + ->findOne(); + } if (!$ccShowInstance || $ccShowInstance->getDbModifiedInstance() == true) { return false; }