V16 - Getting Unsaved Changes when adding content through ContentService

Hi there, I am migrating a large customers data from one CMS to Umb16.
The import works great and I can see all data, BlockLists, images and everything in the backend.
However when I navigate away from the node, I get the “Unsaved changes” pop-up eventhough I haven’t changed a thing.
Saving, publishing etc. from the ContentService doesn’t change this behaviour. Clearing Memory and DB Caches do not solve it either.

I get this for pretty much all items I am importing. I have checked the umbracoPropertyData table and I can indeed see some differences. Primarily on the BlockList or BlockGrid fields. I can see that the JSON value that I inject is different to the JSON value in the database after I save in the backend. There is no data loss everything stays as it is, it’s just the formatting of it that’s different. I have built the import as per the documentation here: https://docs.umbraco.com/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/block-grid-editor

An example of the data difference I have checked with a jsondiff tool:
My import on the left and the stored umbraco content after a manual save and publish on the right. I have not posted the entire json as they are pretty large.

It seems to me that the UI validator checks the fields up against the stored data in the db and if there is a slight difference then I get the warning. It also seems that if there is a field stored with an empty string I also get the error, but if change the import to import a null value then it works. So the validator seems a little too pendatic to me.

Any ideas as to what I can do? Can I disable the popup? Can I somehow trigger Umb to save all my items in the backend, minding that doing it through the ContentService doesn’t work and publish with descendants from the backoffice doesn’t cut it either?

Hi @michaeloxygen

It looks like the Content you added is formatted in the old Block Data Format, where each value is stored as a Property using the Property Alias as the Property Name.

This was changed in v.15, when we introduced Block Level Variants; this version migrated all Blocks Property Values to become an array of values as you see in the right side.

That seems like the main thing, so I would start making sure that your data gets up-to-date with the latest structure.

I hope that helps you move forward :slight_smile:

The Unsaved Changes Check is very sensitive, so that may trick you a bit later as well.

But it surely is a change to go from your left to the right side, in your case, it’s just one that happily gives the same output on your website. But for the Unsaved Changes Check to know about that it would have to be extremely smart. I hope that perspective makes sense :slight_smile:

Hi Niels,
Thanks for your reply. I can see there is indeed a change there I hadn’t noticed. I’ll go ahead and adjust that accordingly, thanks for pointing that out :slight_smile:

1 Like