From 52f294b30424483aa74d069b837b140f68cca020 Mon Sep 17 00:00:00 2001 From: "S.Listl" <s.listl@adito.de> Date: Thu, 28 Nov 2019 15:50:33 +0100 Subject: [PATCH] AttributeRelation: void-attributes deletable --- .../entityfields/value/valueProcess.js | 4 +++- .../recordcontainers/jdito/onDelete.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/entity/AttributeRelation_entity/entityfields/value/valueProcess.js b/entity/AttributeRelation_entity/entityfields/value/valueProcess.js index 0257edcb7c..ae579d7b00 100644 --- a/entity/AttributeRelation_entity/entityfields/value/valueProcess.js +++ b/entity/AttributeRelation_entity/entityfields/value/valueProcess.js @@ -6,4 +6,6 @@ import("system.result"); var attributeType = vars.get("$field.ATTRIBUTE_TYPE"); var contentType = AttributeTypeUtil.getContentType(attributeType); if (!vars.get("$this.value") && contentType == "BOOLEAN") - result.string("0"); \ No newline at end of file + result.string("0"); +else if (!contentType) + result.string(""); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/recordcontainers/jdito/onDelete.js b/entity/AttributeRelation_entity/recordcontainers/jdito/onDelete.js index 607a023f25..dd430c9439 100644 --- a/entity/AttributeRelation_entity/recordcontainers/jdito/onDelete.js +++ b/entity/AttributeRelation_entity/recordcontainers/jdito/onDelete.js @@ -4,7 +4,7 @@ import("Sql_lib"); import("system.db"); var rowData = vars.get("$local.rowdata"); -if (rowData["AB_ATTRIBUTE_ID.value"] && rowData["VALUE.value"]) +if (rowData["AB_ATTRIBUTE_ID.value"]) { db.deleteData("AB_ATTRIBUTERELATION", SqlCondition.equals("AB_ATTRIBUTERELATION.AB_ATTRIBUTERELATIONID", vars.get("$local.uid"), "1=2")); } \ No newline at end of file -- GitLab