proper..Value<IEnumerable<IPublishedContent>>("FieldName") no longer works after upgrading to 8.5
Hi all,
Have a project that needs to be upgraded (was 8.0.2) and have upgraded the system to the latest version of Umbraco (8.5.3). The upgrade has worked, and back end is working but when doing regression testing on the front end, data retrieval seems to no longer work as it used too:
for example, i have a custom property on a member model and this was working fine:
var relatedProfile = currentMember.Value<IEnumerable<IPublishedContent>>("RelatedProfile");
but now, this is null and the Value seems to want to return a models builder type from Umbraco.Web.PublishedModels.
Models builder is used on this site so i can't simply turn it off, but i also do not want to be forced down a route of using the published models, the way the app is built it needs to us IPublishedContent, otherwise it will be broken all over the place.
I may have missed this, i read through the changes to IPublishedContent, didn't seem to see anything like this?
Do the properties in question only allow a single item to be selected? If so you may need to change IEnumerable<IPublishedContent> to IPublishedContent.
I cant remeber when the property converts became aware of the max items prevalue.
proper..Value<IEnumerable<IPublishedContent>>("FieldName") no longer works after upgrading to 8.5
Hi all,
Have a project that needs to be upgraded (was 8.0.2) and have upgraded the system to the latest version of Umbraco (8.5.3). The upgrade has worked, and back end is working but when doing regression testing on the front end, data retrieval seems to no longer work as it used too:
for example, i have a custom property on a member model and this was working fine:
but now, this is null and the
Value
seems to want to return a models builder type fromUmbraco.Web.PublishedModels
.Models builder is used on this site so i can't simply turn it off, but i also do not want to be forced down a route of using the published models, the way the app is built it needs to us IPublishedContent, otherwise it will be broken all over the place.
I may have missed this, i read through the changes to IPublishedContent, didn't seem to see anything like this?
Hi,
Do the properties in question only allow a single item to be selected? If so you may need to change
IEnumerable<IPublishedContent>
toIPublishedContent
.I cant remeber when the property converts became aware of the max items prevalue.
Hope this helps
Matt
Hi Matt,
Yeah thats what it was, i figured it out just after i posted. Means a bit of reworking now needs to happen, but at least its a fundamental shift.
Thanks
is working on a reply...