Copied to clipboard

Flag this post as spam?

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


  • Jeroen Breuer 4830 posts 11919 karma points admin mvp c-trib
    5 days ago
    Jeroen Breuer
    0

    UmbracoContext.Current.MediaCache.GetById(id) is null after upgrade

    Hello,

    I've upgrade our website from 7.4.3 to 7.7.6. Now the following code always returns null:

    UmbracoContext.Current.MediaCache.GetById(id)
    

    I've rebuild the xml cache and all Examine indexes, but I still get the error.

    Since this is an upgrade I've set the following in umbracoSettings.config:

    <EnablePropertyValueConverters>false</EnablePropertyValueConverters>
    

    Any idea why the code doesn't work anymore?

    Jeroen

  • Dan Diplo 1165 posts 4140 karma points mvp
    5 days ago
    Dan Diplo
    0

    Hi Jeroen,

    Hmmm, I've got a few sites upgraded to 7.7.6 and the above works for me, though I do leave EnablePropertyValueConverters as true (and have Umbraco Core Property Value Converters still installed).

    Have you tried setting it to true?

    Also, have you tried rebuilding the internal Examine cache and maybe an app restart?

  • Jeroen Breuer 4830 posts 11919 karma points admin mvp c-trib
    5 days ago
    Jeroen Breuer
    0

    We already have some custom property value converters and those will probably break when the default 7.6 ones are enabled.

    Already tried rebuilding the internal Examine cache and an app restart.

    Jeroen

  • Dan Diplo 1165 posts 4140 karma points mvp
    5 days ago
    Dan Diplo
    0

    What is Id that you are passing? An integer or is it an umb://media/ UDI? If the latter you'll need to write converters that deal with these, I guess..

Please Sign in or register to post replies

Write your reply to:

Draft