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")) {
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.
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?
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
}
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.
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
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
is working on a reply...