Copied to clipboard

Flag this post as spam?

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


  • Carlos Casalicchio 138 posts 561 karma points
    Dec 17, 2020 @ 15:09
    Carlos Casalicchio
    0

    Unpublished node Id returns parent Node

    In the code, the method checks if node Id is published. But, since it's not, it's returning the parent instead. Is this intended?

    Example: New Node (not saved or published yet) Id => 2129

    var newNode = Services.ContentService.GetById(nodeId);
    var newNode = Umbraco.Content(nodeId);
    var newNode = UmbracoContext.Content.GetById(nodeId)
    

    All lines return the parent, and not null, as expected (since the node does not yet exist).

    Is there another way of checking this?

    Url Segment: /umbraco#/content/content/edit/2129?doctype=project&create=true

Please Sign in or register to post replies

Write your reply to:

Draft