Compatibility with Redmine 4

This commit is contained in:
Karel Pičman 2018-12-19 14:13:37 +01:00
parent 3f11d9eec5
commit 546c12c087

View File

@ -103,8 +103,7 @@ class CustomWorkflow < ActiveRecord::Base
def validate_syntax_for(object, event) def validate_syntax_for(object, event)
object.instance_eval(read_attribute(event)) if respond_to?(event) && read_attribute(event) object.instance_eval(read_attribute(event)) if respond_to?(event) && read_attribute(event)
rescue WorkflowError => e rescue WorkflowError => _
errors.add event, :invalid_script, :error => e
rescue Exception => e rescue Exception => e
errors.add event, :invalid_script, :error => e errors.add event, :invalid_script, :error => e
end end