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?
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 :-)
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.
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?
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?
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 :-)
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.
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?
is working on a reply...