From dc126667712b29fb2cb4f8cf2dd6d3210648f50d Mon Sep 17 00:00:00 2001
From: "S.Listl" <S.Listl@SLISTL.aditosoftware.local>
Date: Mon, 27 Jan 2020 17:12:03 +0100
Subject: [PATCH] Object relations wrong direction after insert

---
 .../ObjectTree_entity/recordcontainers/jdito/contentProcess.js  | 2 ++
 entity/ObjectTree_entity/recordcontainers/jdito/onInsert.js     | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js b/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js
index eedfa1d7de..6ed5a08a23 100644
--- a/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js
+++ b/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js
@@ -18,6 +18,8 @@ import("Contact_lib");
  * - the "tree" is returned
  */
 
+//TODO: Refactoring in this process. It's rather hard to understand and uses more sql queries than necessary.
+
 //uid array structure
 var UID = {
     objectId: 0,
diff --git a/entity/ObjectTree_entity/recordcontainers/jdito/onInsert.js b/entity/ObjectTree_entity/recordcontainers/jdito/onInsert.js
index b213c50696..4ff38cdf98 100644
--- a/entity/ObjectTree_entity/recordcontainers/jdito/onInsert.js
+++ b/entity/ObjectTree_entity/recordcontainers/jdito/onInsert.js
@@ -20,7 +20,7 @@ if (selectedObjectRelationTypeId)
         
         var objectId1 = rowdata["PARENT_ID.value"];
         var objectId2 = rowdata["TARGET_ID.value"];
-        if (side == "1")
+        if (side != "1")
             [objectId1, objectId2] = [objectId2, objectId1];
 
         db.insertData("AB_OBJECTRELATION", [
-- 
GitLab