From 112667a2e77ddbe0a4cfb2cfdffb3a95f1d23f3f Mon Sep 17 00:00:00 2001
From: Johannes Hoermann <j.hoermann@adito.de>
Date: Tue, 20 Aug 2019 16:19:38 +0200
Subject: [PATCH] fix Context_entity

---
 .../recordcontainers/jdito/contentProcess.js         | 12 +++++++++++-
 process/Context_lib/process.js                       |  3 ++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/entity/Context_entity/recordcontainers/jdito/contentProcess.js b/entity/Context_entity/recordcontainers/jdito/contentProcess.js
index 724a3ee8aaa..d061ec44cab 100644
--- a/entity/Context_entity/recordcontainers/jdito/contentProcess.js
+++ b/entity/Context_entity/recordcontainers/jdito/contentProcess.js
@@ -7,6 +7,16 @@ if (excludeContexts)
     excludeContexts = JSON.parse(excludeContexts);
 var filterContexts = !(vars.exists("$param.GetAllContexts_param") && vars.get("$param.GetAllContexts_param") == "true");
 var useExclusives = vars.exists("$param.UseExclusives_param") && vars.get("$param.UseExclusives_param") == "true";
-var whitelist = vars.exists("$param.Whitelist") && vars.get("$param.Whitelist") ? JSON.parse(vars.get("$param.Whitelist")) : undefined;
+var whitelist;
+
+if (vars.get("$local.idvalues") && vars.get("$local.idvalues").length > 0)
+{
+    whitelist = vars.get("$local.idvalues")
+}
+else
+{
+    whitelist = vars.get("$param.Whitelist") ? JSON.parse(vars.get("$param.Whitelist")) : undefined;
+
+}
 
 result.object(ContextUtils.getContexts(filterContexts, excludeContexts, useExclusives, whitelist));
\ No newline at end of file
diff --git a/process/Context_lib/process.js b/process/Context_lib/process.js
index 50aeb817ca2..91628d6ace6 100644
--- a/process/Context_lib/process.js
+++ b/process/Context_lib/process.js
@@ -90,7 +90,8 @@ ContextUtils.getContextConsumer = function(pContextId)
  * @param {Boolean} [pFilter=false] filter only for contexts which have a mapping in ContextUtils.getSelectMap 
  * @param {String[]} [pExclusiveContexts] contextIds that shall not be included (so this is a additional filter to the pFilter param)
  * @param {Boolean} [pUseExclusives=false] decides whether the items in pExclusiveContexts are excluded (false) or
- *                      everything that is not in pExclusiveContexts is excluded (true)
+ *                      everything that is NOT in pExclusiveContexts is excluded (true) 
+ *                      (-> if it is a whitelist or blacklist)
  * @param {String[]} [pWhitelist=undefined] only allowed contexts
  *
  * @return {String[][]} the contexts [[contextId, contextName, contextTitle], [... ], ...]
-- 
GitLab