I am learning Umbraco (7) and deleted a test document type and template, without realising there was a content page using these (very surprised Umbraco lets you do this!)
I then couldn't access the content page to delete it (404 error). I created a new page, but that also had problems, almost certainly due to the database now having incorrect integrity, ie links now broken.
Two questions :
is there any way to prevent deletions where there are still linked content elements?
How would I fix this? Do I need to delete the orphaned content in the SQL backend db using SQL Management Studio? Or can something be done in the Umbraco front end eg scripts in macros?
Thanks
Unfortunately deleting a document type does in fact remove all content using that document type, I am unaware of any way to recover this content other than to restore a backup.
It is a fundamental flaw I think that you are able to do this so easily and has been there for as long as I have been working with Umbraco (since v3!).
Have you tried rebuilding your XML Cache file to try and overcome the orphaned link problems?
See this issue on the issue tracker:
U4-5187 Deleting doctype wipes out all content nodes based on it