From 39906d1f1247b353cab916eed694b7b403245b1d Mon Sep 17 00:00:00 2001
From: "S.Listl" <S.Listl@SLISTL.aditosoftware.local>
Date: Tue, 26 May 2020 15:46:30 +0200
Subject: [PATCH] 1057920 Loghistory didn't work for ObjectSelection attributes

---
 process/Loghistory_lib/process.js | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/process/Loghistory_lib/process.js b/process/Loghistory_lib/process.js
index 102df509f36..fa07e912c73 100644
--- a/process/Loghistory_lib/process.js
+++ b/process/Loghistory_lib/process.js
@@ -150,6 +150,8 @@ LogHistoryExecutor.prototype.execute = function ()
             {
                 description.push(translate.withArguments("%0 from \"%1\" to \"%2\"", [conf.Description, olddata[0], newdata[0]], this.translationLanguage));
             }
+            else
+                description.push(conf.Description + " " + newdata[0]);
         }
         if (conf.RefTable) this.affectedTable = conf.RefTable;
     } //no extra tables
@@ -284,7 +286,15 @@ LogHistoryExecutor.prototype._getDataForExtras = function(pId, pValues)
     if (this.affectedTable == "AB_ATTRIBUTERELATION") 
     {
         data[0] = AttributeUtil.getFullAttributeName(pId);
-        data[1] = AttributeRelationUtils.selectAttributeValue(pId, pValues, true);
+        //if the attribute type is "OBJECTSELECTION", entities.getRow is used for resolving the displayValue, that can cause an error
+        try {
+            data[1] = AttributeRelationUtils.selectAttributeValue(pId, pValues, true);
+        }
+        catch (err)
+        {
+            logging.log(err);
+            data[1] = null;
+        }
     }
     else if (this.affectedTable == "COMMUNICATION")
     {
-- 
GitLab