Copied to clipboard

Flag this post as spam?

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


  • Roy Berris 89 posts 577 karma points c-trib
    Dec 13, 2021 @ 10:28
    Roy Berris
    0

    IContentService.GetById returning null while published content is available

    I have a node in it's IPublishedContent variant. Now when I try to get it from the IContentService.GetById the content service returns null.

    enter image description here

    You can see that the publishedContent has a value, but why does the IContentService not return the published content as IContent? I need it to delete the content programatically.

    I know IContentService is initialized properly because I can get other items with it.

  • Roy Berris 89 posts 577 karma points c-trib
    Dec 13, 2021 @ 10:39
    Roy Berris
    101

    Got a solution. Instead of parsing the publishedContent.Id I need to give it the Key. Which is weird because the method accepts both. But Id seems to be broken for whatever reason in our project.

Please Sign in or register to post replies

Write your reply to:

Draft