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?
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..
The problem was the media item was in the recycle bin. Maybe that just worked on Umbraco 7.4, but in Umbraco 7.7 it returns null for media items. Added a null check and now everything works again.
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:
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:
Any idea why the code doesn't work anymore?
Jeroen
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
astrue
(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?
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
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..The problem was the media item was in the recycle bin. Maybe that just worked on Umbraco 7.4, but in Umbraco 7.7 it returns null for media items. Added a null check and now everything works again.
Jeroen
is working on a reply...