diff --git a/api/src/Storage/Base.php b/api/src/Storage/Base.php index d26a1fdb35..05056723b5 100644 --- a/api/src/Storage/Base.php +++ b/api/src/Storage/Base.php @@ -949,6 +949,11 @@ class Base { if (!in_array($col, $colums) && !in_array($col, $as_columns)) { + // make sure column-name is not ambigous + if ($join && strpos($join, $this->table_name.'.'.$col)) + { + $col = $this->table_name.'.'.$col.' AS '.$col; + } $colums[] = $col; } }