Copied to clipboard

Flag this post as spam?

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


  • Karl Kopp 121 posts 227 karma points
    Feb 11, 2012 @ 00:35
    Karl Kopp
    0

    Razor foreach loop returning unublished children

    Howdy all - I have a simple foreach loop (code below) and its returning children that are unpublished (they were set to unpublish at a certain time). I've added .Where("Visible") but it doesn't make any difference. Anyone got any ideas??

    foreach (var item in @Model.Children.Where("Visible")

    @item.Name

    }

  • Karl Kopp 121 posts 227 karma points
    Feb 11, 2012 @ 00:41
    Karl Kopp
    0

    To add extra details, if you manually publish/unpublish then it works as expected. But if the unpublish is scheduled then it doesn't remove the item from the node list even tho its marked unpublished in the back office.

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Feb 11, 2012 @ 02:44
    Tom Fulton
    0

    Hi Karl,

    What version of umbraco are you using?  I think there were some issues with scheduled unpublishing in the past.  

    I don't think the issue has to do with Razor, it's probably that the content still exists in your XML cache as it's not getting "fully" unpublished.  You should check your umbracoLog table for errors around the time the page was supposed to be unpublished for clues.  Also are you using load balancing/distributed calls?

    -Tom

  • Karl Kopp 121 posts 227 karma points
    Feb 11, 2012 @ 05:15
    Karl Kopp
    0

    Version:umbraco v 4.7.1 (Assembly version: 1.0.4281.20201)

    No LB/distributed calls.

    Any idea on where u saw this in the past?? Will check the log table this arvo...

    Cheers - Kolchy

Please Sign in or register to post replies

Write your reply to:

Draft