From d800d800d5346ea9a526ba2a880fc93a6892da98 Mon Sep 17 00:00:00 2001 From: Jens Vannerum Date: Wed, 8 Nov 2023 12:02:37 +0100 Subject: [PATCH] 108055: isClosed method should use xml configuration --- .../app/rest/converter/SubmissionFormConverter.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/SubmissionFormConverter.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/SubmissionFormConverter.java index 4febcd559479..daea935f53ff 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/SubmissionFormConverter.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/SubmissionFormConverter.java @@ -125,7 +125,7 @@ private SubmissionFormFieldRest getField(DCInput dcinput, String formName) { dcinput.getVocabulary())); selMd.setClosed( isClosed(dcinput.getSchema(), dcinput.getElement(), dcinput.getQualifier(), - dcinput.getPairsType(), dcinput.getVocabulary())); + dcinput.getPairsType(), dcinput.getVocabulary(), dcinput.isClosedVocabulary())); } else { inputRest.setType(inputType); } @@ -145,7 +145,7 @@ private SubmissionFormFieldRest getField(DCInput dcinput, String formName) { selMd.setControlledVocabulary(getAuthorityName(dcinput.getSchema(), dcinput.getElement(), pairs.get(idx + 1), dcinput.getPairsType(), dcinput.getVocabulary())); selMd.setClosed(isClosed(dcinput.getSchema(), dcinput.getElement(), - dcinput.getQualifier(), null, dcinput.getVocabulary())); + dcinput.getQualifier(), null, dcinput.getVocabulary(), dcinput.isClosedVocabulary())); } selectableMetadata.add(selMd); } @@ -212,9 +212,11 @@ private String getAuthorityName(String schema, String element, String qualifier, } private boolean isClosed(String schema, String element, String qualifier, String valuePairsName, - String vocabularyName) { - if (StringUtils.isNotBlank(valuePairsName) || StringUtils.isNotBlank(vocabularyName)) { + String vocabularyName, boolean isClosedVocabulary) { + if (StringUtils.isNotBlank(valuePairsName)) { return true; + } else if (StringUtils.isNotBlank(vocabularyName)) { + return isClosedVocabulary; } return authorityUtils.isClosed(schema, element, qualifier); }