From e0a2631e388cfb3cd42835089f01e1685a5cea92 Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Tue, 23 Apr 2019 19:29:39 +0100 Subject: [PATCH 1/3] Post release fix for required files. --- lib/Xmds/Soap.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Xmds/Soap.php b/lib/Xmds/Soap.php index 4f604f6455..c8b3fd3f7b 100644 --- a/lib/Xmds/Soap.php +++ b/lib/Xmds/Soap.php @@ -366,7 +366,7 @@ protected function doRequiredFiles($serverKey, $hardwareKey, $httpDownloads) // Build up the other layouts into an array foreach ($sth->fetchAll() as $row) { - $layouts[] = $this->getSanitizer()->int($row['layoutID']); + $layouts[] = $this->getSanitizer()->int($row['layoutId']); } // Also look at the schedule @@ -465,21 +465,22 @@ protected function doRequiredFiles($serverKey, $hardwareKey, $httpDownloads) ) "; + $params = ['displayId' => $this->display->displayId]; + if ($playerVersionMediaId != null) { $SQL .= " UNION ALL SELECT 5 AS DownloadOrder, storedAs AS path, media.mediaId AS id, media.`MD5`, media.fileSize FROM `media` WHERE `media`.type = 'playersoftware' - AND `media`.mediaId = %d + AND `media`.mediaId = :playerVersionMediaId "; + $params['playerVersionMediaId'] = $playerVersionMediaId; } $SQL .= " ORDER BY DownloadOrder "; - $sth = $dbh->prepare(sprintf($SQL, $layoutIdList, $layoutIdList, $playerVersionMediaId)); - $sth->execute(array( - 'displayId' => $this->display->displayId - )); + $sth = $dbh->prepare(sprintf($SQL, $layoutIdList, $layoutIdList)); + $sth->execute($params); // Prepare a SQL statement in case we need to update the MD5 and FileSize on media nodes. $mediaSth = $dbh->prepare('UPDATE media SET `MD5` = :md5, FileSize = :size WHERE MediaID = :mediaid'); From 1533f7a9a7771bb7c64c114ae9aae3b59895b7af Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Tue, 23 Apr 2019 19:46:46 +0100 Subject: [PATCH 2/3] Post release fix/extra logging for required files. --- lib/Xmds/Soap.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Xmds/Soap.php b/lib/Xmds/Soap.php index c8b3fd3f7b..bee6ffbb02 100644 --- a/lib/Xmds/Soap.php +++ b/lib/Xmds/Soap.php @@ -397,7 +397,7 @@ protected function doRequiredFiles($serverKey, $hardwareKey, $httpDownloads) $eventTypeId = $row['eventTypeId']; if ($eventTypeId == Schedule::$LAYOUT_EVENT || $eventTypeId == Schedule::$OVERLAY_EVENT) { - $layouts[] = $row['layoutId']; + $layouts[] = $this->getSanitizer()->int($row['layoutId']); } } @@ -479,7 +479,14 @@ protected function doRequiredFiles($serverKey, $hardwareKey, $httpDownloads) $SQL .= " ORDER BY DownloadOrder "; - $sth = $dbh->prepare(sprintf($SQL, $layoutIdList, $layoutIdList)); + // Sub layoutId list + $SQL = sprintf($SQL, $layoutIdList, $layoutIdList); + + if ($this->display->isAuditing()) { + $this->getLog()->sql($SQL, $params); + } + + $sth = $dbh->prepare($SQL); $sth->execute($params); // Prepare a SQL statement in case we need to update the MD5 and FileSize on media nodes. From a5ae2b468b28c7e51ca2737cc91456ad0384ec71 Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Tue, 23 Apr 2019 20:06:34 +0100 Subject: [PATCH 3/3] Post release fix scheduled empty campaigns --- lib/Xmds/Soap.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Xmds/Soap.php b/lib/Xmds/Soap.php index bee6ffbb02..87f21b4636 100644 --- a/lib/Xmds/Soap.php +++ b/lib/Xmds/Soap.php @@ -394,10 +394,9 @@ protected function doRequiredFiles($serverKey, $hardwareKey, $httpDownloads) $this->getLog()->debug(count($scheduleEvents) . ' events for eventId ' . $schedule->eventId); - $eventTypeId = $row['eventTypeId']; - - if ($eventTypeId == Schedule::$LAYOUT_EVENT || $eventTypeId == Schedule::$OVERLAY_EVENT) { - $layouts[] = $this->getSanitizer()->int($row['layoutId']); + $layoutId = $this->getSanitizer()->int($row['layoutId']); + if ($layoutId != null && ($schedule->eventTypeId == Schedule::$LAYOUT_EVENT || $schedule->eventTypeId == Schedule::$OVERLAY_EVENT)) { + $layouts[] = $layoutId; } }