Copied to clipboard

Flag this post as spam?

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


  • Fernando Camillo 41 posts 82 karma points
    Mar 31, 2011 @ 16:30
    Fernando Camillo
    0

    Working in backend, but problem in frontend

    Hi Richard.

    I noticed that in the backend the page is not deleted (nice!), however in the frontend the page is gone (page not found error). The page only returns in the frontend when I republish it. Maybe some cache problem?

    Thanks.

    Fernando
    Umbraco 4.5.2 for .Net 3.5 with MySQL 5.1

  • Richard Soeteman 3968 posts 12470 karma points MVP
    Mar 31, 2011 @ 16:37
    Richard Soeteman
    0

    Hi,

    I think it gets unpublished before the item gets deleted, not much I can do about that :-(.For the next version I will remove the delete button based on the property since I know a nice way to cache things now.

    Cheers,

    Richard

     

     

  • Dan Diplo 1545 posts 6118 karma points MVP 4x c-trib
    Oct 27, 2011 @ 15:37
    Dan Diplo
    0

    Since the document gets unpublished you could just re-publish again after preventing it from being deleted. So you could change your method to something like:

       private static bool CheckDisabledForDelete(Document document)
        {
            const string DISABLEDELETEALIAS = "umbracoDisableDelete";
    
            bool cancel = document.getProperty(DISABLEDELETEALIAS) != null && document.getProperty(DISABLEDELETEALIAS).Value.Equals(1);
            if (cancel)
            {
                document.Publish(umbraco.BusinessLogic.User.GetUser(0));
            }
            return cancel;
        }

     

Please Sign in or register to post replies

Write your reply to:

Draft