FIX wrong alias of table if no parent and parentkey
This commit is contained in:
parent
391c02993d
commit
ffa79c59f9
@ -4413,7 +4413,11 @@ abstract class CommonObject
|
|||||||
$sql.= " AND c.".$element['parentkey']." = p.rowid";
|
$sql.= " AND c.".$element['parentkey']." = p.rowid";
|
||||||
}
|
}
|
||||||
if (!empty($entity)) {
|
if (!empty($entity)) {
|
||||||
$sql.= " AND p.entity = ".((int) $entity);
|
if (!empty($element['parent']) && !empty($element['parentkey'])) {
|
||||||
|
$sql.= " AND p.entity = ".((int) $entity);
|
||||||
|
} else {
|
||||||
|
$sql.= " AND c.entity = ".((int) $entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user