I'm trying to to prevent the deletion of media items by some CMS users. I want to do that by canceling the MediaService_Trashing event and show a warning message to the user.
Is this the way to go and are there any examples on how to do this?
Thanks for your reaction. Your code looks exactly like the thing I tried. :-) But it just doesn't seems to work. The delete gets canceled, but I don't see the message.
I think its a bug. :-(
I think it should read 'Currently only some Content and Media services...'. To date, I've found that messaging has only been enabled for some events. In particular, MediaService.Trashing and ContentService.UnPublishing don't generate messages. It's a real pain!!
I am trying to do the same thing, I need to prevent certain media types from being deleted (which works fine) but show a message to the user to let them know that they cannot delete the item.
Preventing the deletion of media items
Hi all,
I'm trying to to prevent the deletion of media items by some CMS users. I want to do that by canceling the MediaService_Trashing event and show a warning message to the user.
Is this the way to go and are there any examples on how to do this?
Any help is appreciated :-)
Sander
I'm guessing it would be something like this:
Not tested, but that's the theory.
Hello Dan,
Thanks for your reaction. Your code looks exactly like the thing I tried. :-) But it just doesn't seems to work. The delete gets canceled, but I don't see the message. I think its a bug. :-(
Greets, Sander
Yep, I also have this bug in 7.5.4
Same problem here.
I guess this is really an umbraco related bug. Not something i did.
Programming rule 1:
Always find someone to put the blame on!
This error is shown in the browser console:
This may be relevant...
http://issues.umbraco.org/issue/U4-6872
A
Hi Angus,
but the issues says that it is implemented in the media service. So what am i missing?
Best regards Nils
Hi Nils,
I think it should read 'Currently only some Content and Media services...'. To date, I've found that messaging has only been enabled for some events. In particular, MediaService.Trashing and ContentService.UnPublishing don't generate messages. It's a real pain!!
A
Hi Angus,
Uhh thats annoying, but thanks anyway. Im gonna look for a work-around and post it here.
Best regards Nils
Did you find a solution or workaround to this?
I am trying to do the same thing, I need to prevent certain media types from being deleted (which works fine) but show a message to the user to let them know that they cannot delete the item.
Hi, check out Protect Used Media package. Best Piotr
is working on a reply...