This entity cannot be deleted because it is in use

Dec 10, 2014 at 10:59 AM
Edited Dec 10, 2014 at 11:01 AM
I recieve the message ' This entity cannot be deleted because it is in use' while trying to delete entities in an app-project in the manage-app settings. This happens even when there is no 'instance' of the app at all in the portal. There is no relationsship to other data. I'm also unable to change the Type of Content in the Templatesetting ( 'Setting off since already in use' ).
In the Items-grid i've tried to edit status:'IsPublished' to false, but still not able to delete.

What i've missed here?

thanks and greetz roxl

DNN 7.3.4 2sxc 6.5.1
Coordinator
Dec 10, 2014 at 12:20 PM
You probably have another entity which referrs to this. Example

You have a category "Glass" being used by some Gallery-Items (entity-relationship)

Even if the gallery-items are not shown, the reference to "Glass" stands, so you can't delete that category.
Dec 12, 2014 at 11:24 AM
Erstmal vielen Dank für die Antwort.

I was afraid to get this answer. The messages of 2sxc must lead to this.
But there are no entity-relationships.
In difference to other apps I have used Data Pipelines and Filter-options here:
@using ToSic.Eav.DataSources
@using ToSic.SexyContent


@{

    var allFeature = CreateSource<ValueFilter>(App.Data["Feature"]);
    allFeature.Attribute = "IstInWeiss";
    allFeature.Value = "True";

    var allWhiteTrue = AsDynamic(allFeature.List).OrderByDescending(x => x.IstInSchwarz).ThenBy(x => x.Name);
    
}
Could this cause the issue?
However, one quick try would be to recreate a new app. Maybe i've messed things up.

thank you
greetz from Basel

roxl
Dec 12, 2014 at 11:33 AM
This should not cause the issue

I only has errors like this if there was content assigned to it at the following way
  • the item you want to delete has been set as the initial content for an item
  • the content item is an entity item of another item ( again also make sure to look in the initial item especially ones that have entity types if the content you want to delete is not one of those
  • Reused content - if you have one item in module 1 and the same in another module you used the same type and added an item using the add existing content ( very familiar to me :)
@2sics there a sql query we can use to find out if a content item is in use adn for which modules so we can easier track it down?
Dec 12, 2014 at 12:18 PM
Edited Dec 12, 2014 at 2:08 PM
thx nokiko
Reused content - if you have one item in module 1 and the same in another module you used the same type and added an item using the add existing content ( very familiar to me :)
That's exactly what i've done. Cause the app access the content through CreateSource<> the concrete List of Items in one module does not matter. the template just grab all saved items. In a second instance/module (with a different template) i've unnecessarily added the same existing content (the template ask for at least one item to render, although i choosed the 'no content type' option).
Well, after deleting all items in the list of the second module, and even after deleting the second instance at all, i can no longer delete any item in the app management.

tricky to me.....

thank you

roxl

UPDATE: I've uninstalled the app (leaving an '(error)' app in the applist :D ). After Reimport the App i was able to clean up the Content. thanks for your support.