Fix regression: bad cache management of linked object loading.

This commit is contained in:
Laurent Destailleur 2022-04-12 22:35:12 +02:00
parent 04ad919a2c
commit 914b037a9a

View File

@ -3847,7 +3847,7 @@ abstract class CommonObject
} else {
$sql .= "(fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."')";
$sql .= " ".$clause." (fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."')";
if ($this->id > 0 && $sourceid == $this->id && $sourcetype == $this->element && $targetid == $this->id && $targettype == $this->element && $clause == 'OR') {
if ($loadalsoobjects && $this->id > 0 && $sourceid == $this->id && $sourcetype == $this->element && $targetid == $this->id && $targettype == $this->element && $clause == 'OR') {
$this->linkedObjectsFullLoaded[$this->id] = true;
}
}