Copied to clipboard

Flag this post as spam?

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


  • Christian A 24 posts 98 karma points c-trib
    Mar 07, 2019 @ 12:12
    Christian A
    0

    ContentService returns deleted content

    I am using the ContentService to validate the existence of a node (i am aware of its cost, but i need to retrieve it nomatter if it is published, unpublished or trashed).

    However i am experiencing some unexpected behaviour. From what i have read in numerous forums posts, the ContentService always access the DB directly (and thus it has a high cost).

    Now my problem is that it does not seem to access the DB directly but some kind of cache. Using the ContentService it retrieves the node in question even if it is deleted (even if it is deleted several minutes ago). After recycling the application pool it will return "null", which i expected it to do as soon as the node was deleted.

    Steps to reproduce:

    • Retrieve a node using ContentService.GetById()
    • => Returns the node as expected
    • Delete the node using the Umbraco backoffice
    • Retrieve the node again using ContentService.GetById()
    • => Still returns the node. Looking in the DB the node is deleted.

    Is this expected behaviour when using the ContentService?

    Using Umbraco 7.13.1

Please Sign in or register to post replies

Write your reply to:

Draft