FIX Empty FROM clause

This commit is contained in:
Daniel Hensby 2016-05-10 17:02:37 +01:00
parent 5b275376d3
commit 3738d888e0
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E

View File

@ -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\"");
}