Skip to content

Commit

Permalink
fix: broken multi-selection in process creation for vocabulary lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominick Leppich committed Oct 11, 2024
1 parent 8ee45f3 commit 76f70be
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/main/java/de/sub/goobi/forms/ProzesskopieForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -459,25 +459,15 @@ private AdditionalField readAdditionalFieldConfiguration(HierarchicalConfigurati
List<HierarchicalConfiguration> parameterList = item.configurationsAt("select");
/* Children durchlaufen und SelectItems erzeugen */

if (!parameterList.isEmpty()) {
if (item.getBoolean("@multiselect", true)) { // NOSONAR
fa.setMultiselect(true);
} else {
fa.setMultiselect(false);
}
fa.setSelectList(new ArrayList<>());
}
fa.setMultiselect(item.getBoolean("@multiselect", true));

if (parameterList.size() == 1) {
fa.setWert(parameterList.get(0).getString("."));
fa.setMultiselect(false);
}

for (HierarchicalConfiguration hc : parameterList) {
String svalue = hc.getString("@label");

String sid = hc.getString(".");
fa.getSelectList().add(new SelectItem(sid, svalue, null));
} else if (!parameterList.isEmpty()) {
fa.setSelectList(parameterList.stream()
.map(hc -> new SelectItem(hc.getString("@label"), hc.getString("."), null))
.toList());
}

String vocabularyTitle = item.getString("@vocabulary");
Expand Down

0 comments on commit 76f70be

Please sign in to comment.