From 869b3a0dbf9c6996475490ee0c9a785db9639ae4 Mon Sep 17 00:00:00 2001
From: Tobias Feldmann <t.feldmann@adito.de>
Date: Fri, 1 Feb 2019 11:55:24 +0100
Subject: [PATCH] Fix for ATTRIBUTERELATION_VALUE

---
 .../attributerelation_value/valueProcess.js   | 22 ++++++++++++++++++-
 process/Attribute_lib/process.js              | 10 ++++-----
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js b/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js
index 1328a770b8f..334477e1aa5 100644
--- a/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js
+++ b/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js
@@ -5,4 +5,24 @@ import("Attribute_lib");
 var attrField = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID")).getAttributeField();
 
 if (attrField != null) //load the value from the correct field for the type
-    result.string(vars.get(attrField));
\ No newline at end of file
+{
+    switch (attrField)
+    {
+        case "CHAR_VALUE":
+            result.string(vars.get("$field.CHAR_VALUE"));
+            break;    
+        case "DATE_VALUE":
+            result.string(vars.get("$field.DATE_VALUE"));
+            break;
+        case "NUMBER_VALUE":
+            result.string(vars.get("$field.NUMBER_VALUE"));
+            break;
+        case "BOOL_VALUE":
+            result.string(vars.get("$field.BOOL_VALUE"));
+            break;
+        case "ID_VALUE":
+            result.string(vars.get("$field.ID_VALUE"));
+            break;            
+    }
+
+}    
\ No newline at end of file
diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js
index a696893d3a8..2d5cf378f4e 100644
--- a/process/Attribute_lib/process.js
+++ b/process/Attribute_lib/process.js
@@ -151,31 +151,31 @@ AttributeTypes._attributeTypeConfig[AttributeTypes.TEXT] = { //TODO: it would pr
     name : "Text",
     contentType : "TEXT", 
     databaseField : "CHAR_VALUE", 
-    entityField : "$field.CHAR_VALUE"
+    entityField : "CHAR_VALUE"
 };
 AttributeTypes._attributeTypeConfig[AttributeTypes.DATE] = {
     name : "Date",
     contentType : "DATE", 
     databaseField : "DATE_VALUE", 
-    entityField : "$field.DATE_VALUE"
+    entityField : "DATE_VALUE"
 };
 AttributeTypes._attributeTypeConfig[AttributeTypes.NUMBER] = {
     name : "${NUMBER}",
     contentType : "NUMBER", 
     databaseField : "NUMBER_VALUE", 
-    entityField : "$field.NUMBER_VALUE"
+    entityField : "NUMBER_VALUE"
 };
 AttributeTypes._attributeTypeConfig[AttributeTypes.BOOLEAN] = {
     name : "Checkbox",
     contentType : "BOOLEAN", 
     databaseField : "BOOL_VALUE", 
-    entityField : "$field.BOOL_VALUE"
+    entityField : "BOOL_VALUE"
 };
 AttributeTypes._attributeTypeConfig[AttributeTypes.COMBO] = {
     name : "Combobox",
     contentType : "TEXT", 
     databaseField : "ID_VALUE", 
-    entityField : "$field.ID_VALUE"
+    entityField : "ID_VALUE"
 };
 AttributeTypes._attributeTypeConfig[AttributeTypes.GROUP] = {
     name : "Group",
-- 
GitLab