Copied to clipboard

Flag this post as spam?

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


  • RM 33 posts 95 karma points
    Feb 11, 2020 @ 15:10
    RM
    0

    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?

  • Matthew Wise 271 posts 1373 karma points MVP 4x c-trib
    Feb 11, 2020 @ 15:29
    Matthew Wise
    100

    Hi,

    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.

    Hope this helps

    Matt

  • RM 33 posts 95 karma points
    Feb 11, 2020 @ 15:34
    RM
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft