/
Event Subscription Issue with Draft Submissions

Event Subscription Issue with Draft Submissions

The behavior on edit draft submission:

1) Edit a draft submission.
2) Have fields that are in error on the form submit
3) Click on save

This causes the code I wrote to pass the guard condition on eventService.js on line 20.

 

Solutions?
1) Not sure if adding an and condition for !data.draft would solve it as it probably is always true when editing a draft. - Tested this and it always comes in as draft = true on submit of draft

2) Failing a submission should set the data.data.submit flag back to false?

The following seems to prevent the behavior from occuring as a temporary solution until Jason rewrites event subscription:

 

var isValid = form.checkValidity(form.submission.data);

if (isValid) {
data.submit = true;
let that = this;
that.parent.root = form;
form.emit('submitButton', { state: 'submitted', component: that, instance: that, data:form.submission.data }); } else {

form.submit(); data.submit = false;

}

image-20240621-180736.png



nfeli - Discusses the issue in discord on chefs-tldr

 

image-20240621-170959.png

 

Related content

Expected Behaviour - Copy Submission should override submission state
Expected Behaviour - Copy Submission should override submission state
More like this
Invalid data remains in the component without any error message after saving and then reopening a draft
Invalid data remains in the component without any error message after saving and then reopening a draft
More like this
Event Subscription Posts on Deleted and Submitted Submissions
Event Subscription Posts on Deleted and Submitted Submissions
More like this
Event Subscription Endpoints - Mostly Completed
Event Subscription Endpoints - Mostly Completed
More like this
While editing an unpublished form in CHEFS the save button stops working
While editing an unpublished form in CHEFS the save button stops working
More like this
CHEFS Defect - The user is still able to save a draft when navigating away from the form
CHEFS Defect - The user is still able to save a draft when navigating away from the form
More like this