From 3738d888e0fbce48e0d88735edd3455a116937b5 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Tue, 10 May 2016 17:02:37 +0100 Subject: [PATCH] FIX Empty FROM clause --- model/DataQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/DataQuery.php b/model/DataQuery.php index 8fc3b8cc2..79ed50ffb 100644 --- a/model/DataQuery.php +++ b/model/DataQuery.php @@ -661,7 +661,7 @@ class DataQuery { $this->query->addLeftJoin($componentBaseClass, "\"$relationTable\".\"$componentField\" = \"$componentBaseClass\".\"ID\""); } - if(ClassInfo::hasTable($componentClass)) { + if(ClassInfo::hasTable($componentClass) && !$this->query->isJoinedTo($componentClass)) { $this->query->addLeftJoin($componentClass, "\"$relationTable\".\"$componentField\" = \"$componentClass\".\"ID\""); }