umbraco/Umbraco.Forms.Issues

FormSavingNotification CancellOperation does not reset the loader, cannot resave without reloading page.

Closed this issue · 1 comments

A brief description of the issue goes here.

When creating a FormSavingNotication and calling notification.CacnelOperation(new EventMessage()) the loader does not reset to "Save" which means all input gets lost if you need to cancell the formSavingNotification.

image

Reproduction

Steps to reproduce

Follow: https://docs.umbraco.com/umbraco-forms/developer/extending/adding-an-event-handler

Create FormNotificationSavingHandler:

public class FormSavingNotificationHandler : INotificationHandler<FormSavingNotification>
{
    public void Handle(FormSavingNotification notification)
    {
        foreach (var form in notification.SavedEntities)
        {
            notification.CancelOperation(new EventMessage("test", "cancel form saving"));
        }
    }
}
public class NotificationComposer : IComposer
{
    public void Compose(IUmbracoBuilder builder)
    {
        builder.AddNotificationHandler<FormSavingNotification, FormSavingNotificationHandler>();
    }
}

Then create a form and click on save

Expected result

Pop-up with the message and then the save button being set back to "save"

Actual result

But "Save" button keeps being a spinner.

image

Thanks for reporting. We've replicated the issue and resolved it, so will have a fix in the next round of releases.