From 1a1504e2848d0ff70096fd4ce5564311c5a53a72 Mon Sep 17 00:00:00 2001 From: Minh Le Date: Tue, 18 Oct 2022 16:49:40 +0200 Subject: [PATCH] changed joinInner for getBridgeIdBySourceAndOwner to filter by type='object' --- Model/DataObject/ClassDefinition/Data/ObjectBridge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/DataObject/ClassDefinition/Data/ObjectBridge.php b/Model/DataObject/ClassDefinition/Data/ObjectBridge.php index eb93b1e..e0a669b 100644 --- a/Model/DataObject/ClassDefinition/Data/ObjectBridge.php +++ b/Model/DataObject/ClassDefinition/Data/ObjectBridge.php @@ -544,7 +544,7 @@ private function getBridgeIdBySourceAndOwner($object, $bridgeClass, $sourceId) $db = Db::get(); $select = $db->select() ->from(['dor' => 'object_relations_' . $object::classId()], []) - ->joinInner(['dp_objects' => 'object_' . $bridgeClass::classId()], 'dor.dest_id = dp_objects.oo_id', ['oo_id']) + ->joinInner(['dp_objects' => 'object_' . $bridgeClass::classId()], 'dor.dest_id = dp_objects.oo_id AND dor.type = "object"', ['oo_id']) ->where('dor.src_id = ?', $object->getId()) ->where('dp_objects.' . $this->bridgeField . '__id = ?', $sourceId);