Umbraco.TypedMedia returning property values as empty string
I have been trying to upgrade an umbraco site from 6.1.0 to 7.3.7. All has gone largely ok but I have come across an issue trying to display images.
I have an image in the media section (id = 3763) as below:
The properties can be seen to be populated fine here and through the database in the CmsPropertyData table:
However, in my razor scripts when i use the following:
var myImage = Umbraco.TypedMedia(3763);
myImage will return the media item with the correct name, path etc. but all the property values such as umbracoFile are coming back as an empty string.
Has anyone seen this before or knows what I should do about it?
Can't believe I didn't know about media being stored in Examine.
I rebuilt my Examine indexes but still not working.
I have tracked down to further things though that may be of help. The XML Cache Data Integrity sass the content has an error (clicking Fix does not work).
Also my UmbracoTraceLog says:
2016-02-17 10:30:02,400 [P9204/D2/T12] WARN Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache - Dropping property "resources_summary" because it does not belong to the content type.
In Examine MAnagement I can see this "resources_summary" mentioned in my user fields, but to be honest, I have no idea what the resources_summary field is.
This is now fixed. resources_summary was a custom examine user field added to index the old V6 related links control that I have since migrated to an Archetype control. Somehow having this field being indexed was breaking my media cache. Removing this user field from my examineindex.config has solved the issue.
(I still have the issue with getting a cmsContentXml error in the admin site but I'm sure I can figure that out) - EDIT: no longer have this issue either - it was a case of somehow there being a published node in the recycle bin. Emptying the recycle bin sorted that.
Umbraco.TypedMedia returning property values as empty string
I have been trying to upgrade an umbraco site from 6.1.0 to 7.3.7. All has gone largely ok but I have come across an issue trying to display images.
I have an image in the media section (id = 3763) as below:
The properties can be seen to be populated fine here and through the database in the CmsPropertyData table:
However, in my razor scripts when i use the following:
myImage
will return the media item with the correct name, path etc. but all the property values such as umbracoFile are coming back as an empty string.Has anyone seen this before or knows what I should do about it?
Thanks!!
Hello,
Umbraco stores media in Examine. Maybe something went wrong. Did you try to rebuild Examine?
Jeroen
Thanks Jeroen!
Can't believe I didn't know about media being stored in Examine.
I rebuilt my Examine indexes but still not working.
I have tracked down to further things though that may be of help. The XML Cache Data Integrity sass the content has an error (clicking Fix does not work).
Also my UmbracoTraceLog says:
2016-02-17 10:30:02,400 [P9204/D2/T12] WARN Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache - Dropping property "resources_summary" because it does not belong to the content type.
In Examine MAnagement I can see this "resources_summary" mentioned in my user fields, but to be honest, I have no idea what the resources_summary field is.
This is now fixed.
resources_summary
was a custom examine user field added to index the old V6 related links control that I have since migrated to an Archetype control. Somehow having this field being indexed was breaking my media cache. Removing this user field from my examineindex.config has solved the issue.(I still have the issue with getting a cmsContentXml error in the admin site but I'm sure I can figure that out) - EDIT: no longer have this issue either - it was a case of somehow there being a published node in the recycle bin. Emptying the recycle bin sorted that.
is working on a reply...