diff options
Diffstat (limited to 'lib/redmine/hook.rb')
-rw-r--r-- | lib/redmine/hook.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/redmine/hook.rb b/lib/redmine/hook.rb index 5146ccbb8..dba36a91a 100644 --- a/lib/redmine/hook.rb +++ b/lib/redmine/hook.rb @@ -140,7 +140,9 @@ module Redmine default_context = {:controller => self, :project => @project, :request => request} Redmine::Hook.call_hook(hook, default_context.merge(context)) else - default_context = {:controller => controller, :project => @project, :request => request} + default_context = { :project => @project } + default_context[:controller] = controller if respond_to?(:controller) + default_context[:request] = request if respond_to?(:request) Redmine::Hook.call_hook(hook, default_context.merge(context)).join(' ') end end |