diff --git a/Kitodo/src/main/java/org/kitodo/production/metadata/MetadataEditor.java b/Kitodo/src/main/java/org/kitodo/production/metadata/MetadataEditor.java index 5856af657e9..4a5a33c5fbc 100644 --- a/Kitodo/src/main/java/org/kitodo/production/metadata/MetadataEditor.java +++ b/Kitodo/src/main/java/org/kitodo/production/metadata/MetadataEditor.java @@ -198,7 +198,7 @@ private static void addMultipleStructuresWithMetadataGroup(int number, String ty for (int i = 0; i < number; i++) { LogicalDivision newStructure = addLogicalDivision(type, workpiece, structure, position, Collections.emptyList()); - if (Objects.isNull(newStructure) || metadataKey.isEmpty() || metadataKey == null) { + if (Objects.isNull(newStructure) || metadataKey == null || metadataKey.isEmpty()) { continue; } MetadataGroup metadataGroup = new MetadataGroup(); diff --git a/Kitodo/src/main/java/org/kitodo/production/services/data/FilterService.java b/Kitodo/src/main/java/org/kitodo/production/services/data/FilterService.java index 7b3385a0d47..64a65d1c317 100644 --- a/Kitodo/src/main/java/org/kitodo/production/services/data/FilterService.java +++ b/Kitodo/src/main/java/org/kitodo/production/services/data/FilterService.java @@ -261,9 +261,9 @@ private QueryBuilder buildQueryFromCondition(String condition, ObjectType object } private String replaceLegacyFilters(String filter) { - filter.replace("processproperty","property"); - filter.replace("workpiece","property"); - filter.replace("template","property"); + filter = filter.replace("processproperty","property"); + filter = filter.replace("workpiece","property"); + filter = filter.replace("template","property"); return filter; }