Copied to clipboard

Flag this post as spam?

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


  • MaxD23 5 posts 72 karma points
    Aug 05, 2017 @ 15:07
    MaxD23
    0

    Umbraco.Core.Models.PublishedContent.PublishedContentEnumerable' does not contain a definition for 'Split'

    Hello,

    I successfully upgraded a site from 7.2.6 to 7.5.14 but when upgrading to 7.6.0 I have a breaking change and cannot figure out where to look. I have been looking on this the last 2 days so help is definitely required.

    The Homepage use Owl Carousel and the error message is :

    Umbraco.Core.Models.PublishedContent.PublishedContentEnumerable' does not contain a definition for 'Split'

    @if (CurrentPage.HasValue("carouselItems")) {
       var itemIds = CurrentPage.CarouselItems.Split(new string[] { "," },     
       StringSplitOptions.RemoveEmptyEntries);
       var carouselItems = Umbraco.Media(itemIds);
       ...
    

    Thank you

  • Damien Green 72 posts 134 karma points
    Feb 15, 2018 @ 13:06
    Damien Green
    0

    Hi Max,

    I've just encountered exactly the same issue after upgrading one of my sites. The solution is to explicitly add a .ToString() like so:

    @if (CurrentPage.HasValue("carouselItems")) { var itemIds = CurrentPage.CarouselItems.ToString().Split(new string[] { "," },
    StringSplitOptions.RemoveEmptyEntries); var carouselItems = Umbraco.Media(itemIds);

    I'm surprised that no one else has come back to you about this, it's a pretty major breaking change.

    hope this helps,

    Cheers,

    Damien

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies