Skip to content

Commit

Permalink
#4867 - Cannot re-open document for curation if it contains an invali…
Browse files Browse the repository at this point in the history
…d feature value

- Validate only when marking document as finished, but not when putting back into progress
  • Loading branch information
reckart committed Jun 11, 2024
1 parent b6063f5 commit 0a87f66
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0a87f66

Please sign in to comment.