Copied to clipboard

Flag this post as spam?

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


  • Jon Herrell 13 posts 67 karma points
    Aug 11, 2014 @ 18:50
    Jon Herrell
    0

    Event cancellation message for user

    Using Umbraco 7.1, I created an IApplicationEventHandler subclass, and hooked into ContentService.Trashing. In that code, I do an e.Cancel=true to cancel the event from occurring for a certain ContentType.Alias. That part all works.

    However, the user gets no information about what happened. How can I send an error message back to the backoffice user about the cancelled event?

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Aug 11, 2014 @ 19:00
    Bo Damgaard Mortensen
    0

    Hi Jon,

    I'm not entirely sure that method chaining has been implemented to the speechbubble yet. I couldn't find any documentation on it, so if someone else knows about this, please let me know :-)

    While I know this is not a pretty solution, have you tried to simply throw an exception? I remember exceptions being shown as speechbubbles in v. 6.x.x at leat :-)

  • Jon Herrell 13 posts 67 karma points
    Aug 11, 2014 @ 19:19
    Jon Herrell
    0

    I just tried throwing an exception. Because the event handler never returns true or false, the backoffice never sees the end of the event and gets stuck in a "processing mode" with a status bar on the node. I do get an error message saying "Failed to delete node xxx", but it's not my exception message.

  • Jon Herrell 13 posts 67 karma points
    Aug 11, 2014 @ 19:21
    Jon Herrell
    0

    Am I approaching this in the wrong way by using events? Should I be modifying the Delete action in the AngularJS backoffice somehow? If so, where do I find more information about that process?

  • 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