From 1555d049f2a00ef0e7d2ccebbe24f863b0079678 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 21 Jul 2016 13:12:45 +0200 Subject: [PATCH] DirectorDeploymentLog: use predefined aliases... ...to avoid problems with too much intelligence in deeper db abstraction layers --- library/Director/Objects/DirectorDeploymentLog.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/library/Director/Objects/DirectorDeploymentLog.php b/library/Director/Objects/DirectorDeploymentLog.php index a81dc879..3cbf6ff2 100644 --- a/library/Director/Objects/DirectorDeploymentLog.php +++ b/library/Director/Objects/DirectorDeploymentLog.php @@ -75,8 +75,10 @@ class DirectorDeploymentLog extends DbObject { $db = $connection->getDbAdapter(); $query = $db->select() - ->from('director_deployment_log', array('c' => $connection->dbHexFunc('config_checksum'))) - ->where('stage_name = ?'); + ->from( + array('l' => 'director_deployment_log'), + array('c' => $connection->dbHexFunc('l.config_checksum')) + )->where('l.stage_name = ?'); return $db->fetchOne($query, $stage); } @@ -85,8 +87,8 @@ class DirectorDeploymentLog extends DbObject { $db = $connection->getDbAdapter(); $query = $db->select()->from( - 'director_deployment_log', - array('id' => 'MAX(id)') + array('l' => 'director_deployment_log'), + array('id' => 'MAX(l.id)') ); return static::load($db->fetchOne($query), $connection);