diff --git a/entity/AttributeRelation_entity/recordcontainers/jdito/contentProcess.js b/entity/AttributeRelation_entity/recordcontainers/jdito/contentProcess.js index ced0fcc55c0a894225ac0adc15e4f66c3aeb9572..0300adac47dc65390bac9d816bacdcb2583e6d31 100644 --- a/entity/AttributeRelation_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/AttributeRelation_entity/recordcontainers/jdito/contentProcess.js @@ -76,15 +76,18 @@ else if (showEmpty || objectRowId) attributeCond.andIn("AB_ATTRIBUTE.AB_ATTRIBUTEID", possibleAttributes); } - if (vars.exists("$param.FilteredAttributeIds_param") && vars.getString("$param.FilteredAttributeIds_param")) + if (vars.getString("$param.FilteredAttributeIds_param")) { let filteredIds = JSON.parse(vars.getString("$param.FilteredAttributeIds_param")); let filteredCondition = new SqlCondition(); let filteredIdChildren = AttributeUtil.getAllChildren(filteredIds); - filteredCondition.andIn("AB_ATTRIBUTE.AB_ATTRIBUTEID", filteredIdChildren); - filteredCondition.andPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", $AttributeTypes.COMBOVALUE, "# != ?") + if (filteredIdChildren.length > 0) + { + filteredCondition.andIn("AB_ATTRIBUTE.AB_ATTRIBUTEID", filteredIdChildren) + .andPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", $AttributeTypes.COMBOVALUE, "# != ?"); + } // return nothing if filteredAttributeIds is an empty array. (--> and 1=2) attributeCond.andSqlCondition(filteredCondition, "1=2");