From 0a87f66af0b0b4f2d4220174bd05d24b6409e078 Mon Sep 17 00:00:00 2001 From: Richard Eckart de Castilho Date: Tue, 11 Jun 2024 12:31:31 +0200 Subject: [PATCH] #4867 - Cannot re-open document for curation if it contains an invalid feature value - Validate only when marking document as finished, but not when putting back into progress --- .../CuratorWorkflowActionBarItemGroup.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/inception/inception-ui-curation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/curation/actionbar/CuratorWorkflowActionBarItemGroup.java b/inception/inception-ui-curation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/curation/actionbar/CuratorWorkflowActionBarItemGroup.java index d72ef3a367b..8c75b23cc0f 100644 --- a/inception/inception-ui-curation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/curation/actionbar/CuratorWorkflowActionBarItemGroup.java +++ b/inception/inception-ui-curation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/curation/actionbar/CuratorWorkflowActionBarItemGroup.java @@ -133,21 +133,21 @@ protected boolean isEditable() protected void actionToggleCurationState(AjaxRequestTarget aTarget) throws IOException, AnnotationException { - try { - page.actionValidateDocument(aTarget, page.getEditorCas()); - } - catch (ValidationException e) { - page.error("Document cannot be marked as finished: " + e.getMessage()); - aTarget.addChildren(page, IFeedback.class); - return; - } - - AnnotatorState state = page.getModelObject(); - SourceDocument sourceDocument = state.getDocument(); + var state = page.getModelObject(); + var sourceDocument = state.getDocument(); var docState = sourceDocument.getState(); switch (docState) { case CURATION_IN_PROGRESS: + try { + page.actionValidateDocument(aTarget, page.getEditorCas()); + } + catch (ValidationException e) { + page.error("Document cannot be marked as finished: " + e.getMessage()); + aTarget.addChildren(page, IFeedback.class); + return; + } + documentService.setSourceDocumentState(sourceDocument, CURATION_FINISHED); aTarget.add(page); break;