Copied to clipboard

Flag this post as spam?

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

  • Mario Lopez 168 posts 952 karma points MVP 4x c-trib
    Jun 25, 2020 @ 05:30
    Mario Lopez

    IEnumerable empty with no reason

    This is a really strange behaviour and I hope I'm not doing anything silly here. I have this code:

    public class BlogSurfaceController : SurfaceController
        public PartialViewResult ExploreMore(int size = 4)
            var articles = Umbraco.ContentAtXPath("//" + Post.ModelTypeAlias);                  
            return PartialView("Blog/_RandomArticles", articles);

    Super simple. If I hover with the mouse over where the articles are retieved I get 4 articles. Then I hover over the articles variable in the return statement and I get an empty value then I hover over the previos=us articles again and it's empty.

    enter image description here

    I got to this issue trying to get random articles from my blog, when I iterate over the collection the script can't find any articles, but they were there!

  • Mario Lopez 168 posts 952 karma points MVP 4x c-trib
    Jul 01, 2020 @ 22:58
    Mario Lopez

    This was solved upgrading Umbraco to v8.6.3 It's related to this bug:

Please Sign in or register to post replies

Write your reply to: