Copied to clipboard

Flag this post as spam?

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


  • Sandro Fillinich 3 posts 83 karma points
    May 07, 2022 @ 16:49
    Sandro Fillinich
    0

    Umbraco rendering template for unpublished node

    Hi all,

    I am new to Umbraco and I have come across an issue that I cannot resolve.

    I have a News node which is the child of an 'eng' node and can create news article children as:

    /eng/news/article
    

    Now, when I unpublish News, and navigate to /eng/news, instead of throwing a 404 and serving the Page Not Found view, Umbraco still resolves the path and tries to render the News view template passing it the parent node (eng) as the Model (which causes an error due to some methods/properties trying to be accessed which are not present on the parent node).

    Now, this does not happen on any other routes/paths where I unpublish a node. For example: navigating to eng/about-us will result in the Page Not Found view if the AboutUs node is unpublished.

    There are no other nodes by the same name or using the same template in any other place in the content tree. I have cleared the examine indexes and the umbraco.config in the TEMP folder and I can confirm the News node is unpublished in the database, as it does not appear in the IPublishedContent collection when the view is rendered, while having the isPublished field set to false.

    Also, this issue happens locally and on the test/stage sites.

    Please help :)

Please Sign in or register to post replies

Write your reply to:

Draft