From b618fe246c65a18d9a3b18fd40294bf5105891e1 Mon Sep 17 00:00:00 2001
From: "j.goderbauer" <j.goderbauer@adito.de>
Date: Thu, 21 Mar 2019 15:55:12 +0100
Subject: [PATCH] fix several keyword-attribute errors

---
 .../KeywordAttributeRelation_entity.aod           |  1 +
 .../displayValueProcess.js                        | 15 +++++++++++++++
 .../KeywordAttribute_entity.aod                   |  5 +++++
 3 files changed, 21 insertions(+)
 create mode 100644 entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_attribute_id/displayValueProcess.js

diff --git a/entity/KeywordAttributeRelation_entity/KeywordAttributeRelation_entity.aod b/entity/KeywordAttributeRelation_entity/KeywordAttributeRelation_entity.aod
index 4c597e3b69..5a7e7aea17 100644
--- a/entity/KeywordAttributeRelation_entity/KeywordAttributeRelation_entity.aod
+++ b/entity/KeywordAttributeRelation_entity/KeywordAttributeRelation_entity.aod
@@ -31,6 +31,7 @@
       <title>Keyword Attribute</title>
       <consumer>KeywordAttributes</consumer>
       <mandatory v="true" />
+      <displayValueProcess>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_attribute_id/displayValueProcess.js</displayValueProcess>
       <onValueChange>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_attribute_id/onValueChange.js</onValueChange>
     </entityField>
     <entityField>
diff --git a/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_attribute_id/displayValueProcess.js b/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_attribute_id/displayValueProcess.js
new file mode 100644
index 0000000000..3e385da47f
--- /dev/null
+++ b/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_attribute_id/displayValueProcess.js
@@ -0,0 +1,15 @@
+import("system.db");
+import("system.result");
+import("system.vars");
+import("Sql_lib");
+
+var keywordAttributeId = vars.get("$field.AB_KEYWORD_ATTRIBUTE_ID");
+var res = keywordAttributeId;
+if (keywordAttributeId)
+{
+    var sql  = SqlCondition.begin()
+                           .andPrepare("AB_KEYWORD_ATTRIBUTE.AB_KEYWORD_ATTRIBUTEID", keywordAttributeId)
+                           .buildSql("select AB_KEYWORD_ATTRIBUTE.NAME, AB_KEYWORD_ATTRIBUTE.TYPE from AB_KEYWORD_ATTRIBUTE");
+    res = db.cell(sql);
+}
+result.string(res);
\ No newline at end of file
diff --git a/entity/KeywordAttribute_entity/KeywordAttribute_entity.aod b/entity/KeywordAttribute_entity/KeywordAttribute_entity.aod
index 61856ba3ae..e0b2005872 100644
--- a/entity/KeywordAttribute_entity/KeywordAttribute_entity.aod
+++ b/entity/KeywordAttribute_entity/KeywordAttribute_entity.aod
@@ -50,8 +50,13 @@
       <children>
         <entityParameter>
           <name>ContainerName_param</name>
+          <expose v="true" />
           <triggerRecalculation v="false" />
         </entityParameter>
+        <entityParameter>
+          <name>FilterAlreadyUsedByEntryId_param</name>
+          <expose v="true" />
+        </entityParameter>
       </children>
     </entityProvider>
     <entityParameter>
-- 
GitLab