I am having some problems with the current behaviour of the ContentArea, especially the way it deals with deleted (but still referenced) content.For example:
We have 'Page 1' with a ContentArea, we also have 'Page 2' which we add to the ContentArea of 'Page 1'. 'Page 1' now holds a reference to 'Page 2' through the ContentArea. If we now delete 'Page 2' from the CMS we get a message saying 'The page or some of its contents are used in the following places. To avoid errors on the site, make sure that the page is not used anywhere.'
After deleting 'Page 2', and even after removing the page from the Trash folder, a reference to 'Page 2' exists on 'Page 1'. This reference is not visible in the CMS and you're not able to remove it manually, however it gets 'magically' (?) removed when you add/remove/edit contents inside the ContentArea.I understand what is happening but I don't understand why this would be the intended or the wanted behaviour.Maybe someone already found a work-around, next to informing the users of the CMS about the DOs and DON'TsThe user now has to remove the references to the page that he/she wants to delete, however if that page is referenced by dozens of other pages I'd prefer to just remove the whole page and tell the CMS to remove all references to the page. Any ideas?
I know that for the answer is late, but maybe it will help someone else.
We have implemented like functionality where the user can like some item, and we keep likes in the content area as a references to profile pages. So when the profile page is deleted, we need to delete all references to that profile page:
var contentSoftLinkRepo = ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>();
contentSoftLinkRepo.DeleteLinks(deleteInput.Content.ContentLink, (deleteInput.Content as ILocalizable).Language.Name);
deleteInput.Content.ContentLink is a ContentLink of the item that is being deleting in the moment of calling these lines of code.
I hope this will help.