Copied to clipboard

Flag this post as spam?

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


  • Ulf Möllerström 70 posts 247 karma points
    Apr 18, 2023 @ 15:08
    Ulf Möllerström
    0

    OnTrashing CancelOperation messages not working

    Hi guys!

    Trying to update functionality in v. 8.11, and having problems with displaying cancellation message...

        private static void OnTrashing(IContentService sender, MoveEventArgs<IContent> e)
        {
            var content = e.MoveInfoCollection.FirstOrDefault()?.Entity;
            if (content is null) return;
    
            if (!e.CanCancel || !content.Published) return;
    
            e.Messages.Add(new EventMessage(
                "Kan ikke slette",
                "Kontroller der er publiceret, kan ikke slettes.",
                EventMessageType.Warning));
    
            e.Cancel = true;
        }
    

    (The cancellation works fine.)

    Having read other posts, but no luck finding anything with a solution. Also tried .CancelOperation()

Please Sign in or register to post replies

Write your reply to:

Draft