From aea1beaa3ef6b0397c219a25080ad0f75b8cfa07 Mon Sep 17 00:00:00 2001
From: Alexander Schlemmer <alexander@mail-schlemmer.de>
Date: Tue, 5 Apr 2022 09:49:16 +0200
Subject: [PATCH] FIX: Workaround for bug 109 (problems with xml
 representations of list values)

---
 src/caosdb/apiutils.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/caosdb/apiutils.py b/src/caosdb/apiutils.py
index 8714a683..980b76e9 100644
--- a/src/caosdb/apiutils.py
+++ b/src/caosdb/apiutils.py
@@ -742,9 +742,16 @@ def merge_entities(entity_a: Entity, entity_b: Entity):
                 else:
                     raise RuntimeError("Merge conflict.")
         else:
-            entity_a.add_property(
-                entity_b.get_property(key),
-                importance=entity_b.get_importance(key))
+           # TODO: This is a temporary FIX for
+           #       https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/issues/105
+           entity_a.add_property(id=entity_b.get_property(key).id,
+                                 name=entity_b.get_property(key).name,
+                                 datatype=entity_b.get_property(key).datatype,
+                                 value=entity_b.get_property(key).value,
+                                 importance=entity_b.get_importance(key))
+            # entity_a.add_property(
+            #     entity_b.get_property(key),
+            #     importance=entity_b.get_importance(key))
 
     for special_attribute in ("name", "description"):
         sa_a = getattr(entity_a, special_attribute)
-- 
GitLab