Commit 0e7d0f7d authored by Cédric Anne's avatar Cédric Anne Committed by Johan Cwiklinski

Fix entity update propagation for CommonDBRelation items

parent 97ed38fd
......@@ -1506,14 +1506,17 @@ class CommonDBTM extends CommonGLPI {
'FROM' => $item->getTable()
];
$OR = [];
if ($item->isField('itemtype')) {
$query['WHERE'] = [
$OR[] = [
'itemtype' => $this->getType(),
'items_id' => $this->getID()
];
} else {
$query['WHERE'] = [$this->getForeignKeyField() => $this->getID()];
}
if ($item->isField($this->getForeignKeyField())) {
$OR[] = [$this->getForeignKeyField() => $this->getID()];
}
$query['WHERE'][] = ['OR' => $OR];
$input = ['entities_id' => $this->getEntityID()];
if ($this->maybeRecursive()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment