umco / umbraco-inner-content

A helper library for Umbraco Doc Type based property editors providing overlays and conversion helpers
https://our.umbraco.org/projects/backoffice-extensions/inner-content/
MIT License
2 stars 16 forks source link

Edge-case: Removed ContentType, existing Content #19

Open leekelleher opened 6 years ago

leekelleher commented 6 years ago

NOTE: Logging here, so I don't forget about this in future. This is not yet an actionable task.

I've hit an edge-case with Stacked Content, where I have existing Content blocks in the stack, then later I decide to remove specific ContentType from the Stacked Content data-type configuration.

The existing Content block is still in the stack, but when I click to edit it, there is a JS console error.

The error comes from Inner Content not being able to find the corresponding ContentType for that block, see here:

https://github.com/umco/umbraco-inner-content/blob/1.1.0/src/Our.Umbraco.InnerContent/Web/UI/App_Plugins/InnerContent/js/innercontent.controllers.js#L114-L117

The practical developer says "just delete those blocks" ... but I'm wondering if we should do something nicer? Either to display a warning/notification, or let the Content block still be editable?

We can detect in the JS if the ContentType is not available after this line:

https://github.com/umco/umbraco-inner-content/blob/1.1.0/src/Our.Umbraco.InnerContent/Web/UI/App_Plugins/InnerContent/js/innercontent.controllers.js#L229

markadrake commented 5 years ago

Ran into that issue as we developed new stacked content components for our client, and deprecated existing ones (obviously we want there content strategy to be use the latest & greatest). But now they are unable to edit the legacy components.

Party of me is like "Rejoice! Delete and replace your content!" but the other side is like "wow they need to do all that for a typo or link change?".

My opinion - allow them to make edits. It's less of a headache in the long run. A visual message in the backoffice would be nice too. Perhaps make a dictionary entry so that it's configurable? Just ideas :)

leekelleher commented 5 years ago

Thanks @markadrake, I agree, let them make edits.