Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • anthony hall 222 posts 536 karma points
    Oct 12, 2016 @ 17:09
    anthony hall
    0

    Managing Media Items that have been deleted

    I'm looking for recommendations on the best way to manage deleted media.

    I'm looking to locate

    • Media Items that have been deleted are linked from the content tree
    • Media Items with no file reference that are linked from the content tree.
  • Dennis Flæng Jørgensen 35 posts 145 karma points c-trib
    Oct 12, 2016 @ 17:55
    Dennis Flæng Jørgensen
    100

    I'm not sure this is possible. The default property editors that are shipped with Umbraco doesnt hold the media object as the model.value, but rather the Id of the media item. This means that it's only holding an int, and if you iterate over alle properties on a document type, you wont know what is referencing.

    You could of course look for all the property-values with an int and check their property editor, and check if it is a media picker. But you run into a problem if you use custom editors (like a custom slider or something) where you can't be sure if its referencing a media object.

    At least that is my understanding of it. I could be wrong.

  • anthony hall 222 posts 536 karma points
    Oct 19, 2016 @ 13:41
    anthony hall
    0

    Hi Dennis,

    To the best of my knowledge you are right. I managed to write a little tool that locates these using the method you described, As you mentioned it's hard going as there are custom types, archetypes you have to handle

Please Sign in or register to post replies

Write your reply to:

Draft