umco/umbraco-nested-content

Error when deleting DocumentTypes referenced by a Nested Content

csharpforevermore opened this issue · 3 comments

Steps to reproduce

  • Create a document type A
  • Create another document type B
  • Add a Nested Content property to B
  • Ensure that the Nested Content references document type A in its composition
  • Delete document type A

** Expected Behaviour **

  • The CMS behaves without any error messages.

** Actual Behaviour **

  • An error message is displayed. It informs us that the following call returns a 404:

/umbraco/backoffice/UmbracoApi/Content/GetEmpty?contentTypeAlias=documentTypeA&parentId=-20

Of course the querystring will differ between instances depending on names and ID's.

To fix this, you have to edit your Nested Content property. You'll have an empty set of fields where Document Type A used to be referenced from.

Best would go try and do is hook into the deleting event for doc types and do a look up to see if it's in use by a NC instance and if so cancel the delete?

This is definitely still a valid issue, but we didn't do anything with it before migrating the codebase over to Umbraco core (v7.7.0). So the best thing to do is to raise this on the Umbraco issue tracker.