Copied to clipboard

Flag this post as spam?

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


  • Tom Underhill 13 posts 87 karma points
    Jan 19, 2015 @ 16:32
    Tom Underhill
    0

    Custom media properties in 7.2

    I've just upgraded a site from 6.1.6 to 7.2. I was using some custom properties on the Image doc type, which still appear to have their values correctly populated in the back office.

    However, front-end code reports the values of those properties as blank for 99% (but not all) of the images.

    Anyone got any ideas?

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Jan 19, 2015 @ 16:35
    Jeavon Leopold
    0

    Sounds like your Examine indexes may have corrupted (as media uses Examine as a cache).

    If you go into the developer section, you will find a Examine Management dashboard. In the Indexers section you can go to "Index info & tools" for each index and click "Rebuild index".

    Hope this gets those properties back.

    Jeavon

  • Tom Underhill 13 posts 87 karma points
    Jan 20, 2015 @ 10:51
    Tom Underhill
    0

    Hi Jeavon,

    Thanks for your reply - unfortunately I'd tried that, but no luck. I can step through the code and see the properties exist, they're just empty for all but one image (for some reason).

    Anything else you can think of to try?

    Thanks!

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Jan 20, 2015 @ 11:10
    Jeavon Leopold
    0

    Hi Tom,

    If you save a image do the properties appear?

    Jeavon

  • Tom Underhill 13 posts 87 karma points
    Jan 20, 2015 @ 19:39
    Tom Underhill
    0

    Hi Jeavon,

    I'm afraid not. I even created another custom property on the Image doctype, put some data in and saved, and even the new property comes back blank.

    The index management area shows the fields as being in the index ok. BTW I'm on 7.2.1.

    Thanks,

    Tom

  • Tom Underhill 13 posts 87 karma points
    Jan 20, 2015 @ 19:50
    Tom Underhill
    0

    ...and sure enough, if I try:

    @umbraco.library.GetMedia(image.Id, false).Current.InnerXml

    The properties I want are not in the Xml.

    T

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Jan 20, 2015 @ 19:53
    Jeavon Leopold
    0

    Hmm, what about as an experiment you use the media service?

    e.g.

    var ms = ApplicationContext.Services.MediaService;
    var myItem = ms.GetById(1234);
    var myMissingData = myItem.GetValue("myMissingProperty");
    
  • Tom Underhill 13 posts 87 karma points
    Jan 20, 2015 @ 20:02
    Tom Underhill
    0

    Righto, got to the bottom of it.

    I'd accidentally selected previous versions of the images without the custom properties. These old images were in the Recycle Bin in the Media section, hence why I was confused.

    From my testing, it seems that:

    1. Deleted media items still show up in multi-node tree picker fields and are retrieved by the content api as if they were not deleted.

    2. When you add a media item to a multi-node property, the search function over the media library returns items from the Recycle Bin.

    I can understand 1, but if I am right, 2 surely is a bug?

    Cheers,

    Tom

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Jan 20, 2015 @ 20:09
    Jeavon Leopold
    0

    Ah, on 2 I would say yes but that it's not related to the item being in the multinode tree picker, it's just that binned media still show in the search. You can report the issue here.

    On 1, one of the things my value converters package takes care of is this as it doesn't return deleted items from a multinode tree picker (they will show in the back office though). Of course it does a whole load of other stuff as well :)

    Anyhow very glad you got it sorted!

Please Sign in or register to post replies

Write your reply to:

Draft