Copied to clipboard

Flag this post as spam?

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


  • Josh Dubisz 2 posts 92 karma points
    May 12, 2021 @ 22:33
    Josh Dubisz
    0

    TypedContentAtXPath returning unpublished nodes Umbraco 7.15.5

    We're looking to get all of the published nodes of a certain doctype. The current query is the following:

    IEnumerable<IPublishedContent> items = Umbraco.TypedContentAtXPath("//Doctype").ToList();
    

    The query is returning all nodes of the doctype as expected, but we're also getting some unpublished nodes as well (not all of them, only some of them - always the same nodes though)

    The unpublished nodes appearing are also missing from umbraco.config (as they should be)

    Sitewide republishing doesn't do anything to fix the issue, neither does rebuilding umbraco.config - however publishing and unpublishing the offending nodes seems to fix it, at least temporarily. We have a lot of nodes, so manually engaging in this process is an option I'd love to avoid.

    Can someone shed some light on why this is happening and how to fix it? How are unpublished nodes missing from umbraco.config showing up in this query? Thanks

  • Josh Dubisz 2 posts 92 karma points
    May 14, 2021 @ 20:06
    Josh Dubisz
    100

    For anyone else who stumbles upon this, issue was that the Umbraco preview cookie was stored, causing unpublished nodes to be returned. After deleting the cookie manually, everything showed up (and didn't) as expected.

Please Sign in or register to post replies

Write your reply to:

Draft