From 13498ec8919d0961e440f6be54f5c87264b0baac Mon Sep 17 00:00:00 2001
From: Andre Loreth <a.loreth@adito.de>
Date: Tue, 26 Mar 2019 11:17:09 +0100
Subject: [PATCH] Fixed selectMap (Context_lib)

---
 .../recordcontainers/jdito/contentProcess.js          |  2 +-
 .../recordcontainers/jdito/contentProcess.js          |  4 ++--
 process/Context_lib/process.js                        | 11 +++++++----
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js b/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js
index b0ff1bf408..f85cd0bacf 100644
--- a/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js
+++ b/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js
@@ -11,7 +11,7 @@ if (vars.exists("$param.ObjectType_param") && vars.get("$param.ObjectType_param"
     var contextList = JSON.parse(vars.getString("$param.ObjectType_param"));
     contextList.forEach(function (context) 
     {
-        var data = db.table(ContextUtils.getContextDataSql(context, vars.get("$param.ObjectRowId_param")));
+        var data = db.table(ContextUtils.getContextDataSql(context, vars.get("$param.ObjectRowId_param"), true));
         data.forEach(function (row) 
         {
             var record = [];
diff --git a/entity/Object_entity/recordcontainers/jdito/contentProcess.js b/entity/Object_entity/recordcontainers/jdito/contentProcess.js
index fa1404cf0a..49ee3565f7 100644
--- a/entity/Object_entity/recordcontainers/jdito/contentProcess.js
+++ b/entity/Object_entity/recordcontainers/jdito/contentProcess.js
@@ -7,11 +7,11 @@ if (vars.exists("$param.ObjectType_param") && vars.get("$param.ObjectType_param"
 {
     if (vars.exists("$param.ObjectRowId_param") && vars.get("$param.ObjectRowId_param"))
     {
-        result.object(db.table(vars.get("$param.ObjectRowId_param"), ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"), vars.get("$param.ObjectRowId_param"))));
+        result.object(db.table(vars.get("$param.ObjectRowId_param"), ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"), vars.get("$param.ObjectRowId_param"), false)));
     }
     else
     {
-        result.object(db.table(ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"))))
+        result.object(db.table(ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"), undefined, false)))
     }
 } 
 else
diff --git a/process/Context_lib/process.js b/process/Context_lib/process.js
index c328d63048..698392214a 100644
--- a/process/Context_lib/process.js
+++ b/process/Context_lib/process.js
@@ -246,7 +246,7 @@ ContextUtils.getNameSql = function(pContextId, pRowId)
 /**
  * TODO: !!!temporary function until you can get fields from another Entity!!!
  */
-ContextUtils.getContextDataSql = function(pContextId, pRowId)
+ContextUtils.getContextDataSql = function(pContextId, pRowId, pWithDate)
 {
     var selectMap = ContextUtils._getSelectMap()
     var cond = SqlCondition.begin();
@@ -254,7 +254,10 @@ ContextUtils.getContextDataSql = function(pContextId, pRowId)
     {
         cond.andPrepare(selectMap[pContextId][1] + "." + selectMap[pContextId][3], pRowId)
     }
-    
-    return cond.buildSql("select " + selectMap[pContextId][2] + ", " + selectMap[pContextId][0] + ", " + selectMap[pContextId][4]  + " from " + selectMap[pContextId][1], "1=1");
-}
 
+    var dateColumn = "";
+    if (pWithDate === true)
+        dateColumn = ", " + selectMap[pContextId][4];
+
+    return cond.buildSql("select " + selectMap[pContextId][2] + ", " + selectMap[pContextId][0] + dateColumn + " from " + selectMap[pContextId][1], "1=1");
+}
-- 
GitLab