U4-10108 - Unsaved 'work in progress' content can be lost if you navigate away to another part of the site (and you have pressed the save button and a validation message occurred)

Created by Marc Goodson 05 Jul 2017, 12:14:03 Updated by Marc Goodson 30 Jul 2017, 20:59:30

Create a new content item in Umbraco 7

(Don't give it a Name - In Umbraco 6 you had to give it a name to create the content so my users who have recently switched forget to do this)

work on the content for a few hours, picking things, uploading media etc

Press the Save button

You don't get the 'saved' green bar because the name is empty, but you also don't get a red 'this hasn't saved' bar - the only indication that the content hasn't saved is a thin red border around the empty name textbox

However even though the content hasn't been saved to the database because of this missing name, all of the ng-dirty flags on the content are cleared, and so it's now possible to click away to another part of the tree or site section without triggering the 'You have unsaved changes' dialog warning.

Meaning you've lost your work in progress, even though you thought you were pressing Save all along!

Try it!

So I'm thinking a couple of things:

  1. if pressing 'Save' doesn't Save because the 'Name' hasn't been supplied should the validation message be more consistent with the validation message for a required field, (where a notification appears in red) and the Tab is entirely highlighted in red?

  2. Perhaps 'Save' shouldn't clear any ng-dirty flags on fields on the content item, if the item isn't successfully saved, and therefore navigation away wouldn't be possible without the warning?

I can workaround it with a content service Saving event, but think it's worth looking at as part of the core, as editors hate losing content! and if you are in a hurry, and are working on something, and have to switch to something else, the pressing save and switching combination... should better protect you from losing your work in progress!

3 Attachments


Marc Goodson 05 Jul 2017, 17:22:49

Actually saving event never fires - so I've worked around this with a custom property editor that makes sure the name is filled in as content is entered, so it will always save as something

Marc Goodson 30 Jul 2017, 20:59:30

In case anyone stumbles across this and wants the property editor workaround it's here: https://github.com/marcemarc/tooorangey.NameSync

Priority: Normal

Type: Bug

State: Submitted


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 7.6.3

Due in version:


Story Points: