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 117 posts 479 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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies