Closed Seahawk240 closed 2 years ago
Hi,
Change this code:
throw(:abort)
To this:
return true
This will interupt the running.
Hi,
thanks for your reply. I finally came around trying this. Sadly it didn't work any ideas why?
Greetings Matthias
Edit_1: For Clarification what does not work. When i do what you suggest, then the process doesn't get halted, the Issue gets deleted and that's it. When using throw(:abort) then it will. Combining them does not bring any improvements.
This is not possible in the present code. throw :abort
interrupts the plugin's destroy method, but the parent issue's destroy method will continue. return true
is simply ignored.
This code will work in v2.0.6
before destroy
# Suppress the original message "Issue deleted"
self.custom_workflow_messages[:notice] = ''
# Add your own error message
self.custom_workflow_messages[:error] = 'Issue cannot be deleted'
# Return false to stop processing of delete event
return false
This code will work in v2.0.6
It does! Just updated to v2.0.8 Thanks Man! Thanks for your amazing work on this project, really appreciate it!
Hello,
I prevent the deletion of issues once someone worked on them. This way one can delete a new ticket, in the case they made a mistake or something.
My code is as follows:
The deletion of the issue gets prevented but when i click on delete, redmine still tells me deletion worked as intended and raises no errors.
Thank you for this amazing plugin and thanks to anyone willing to help me :)
Greetings Matthias