Check that controller and request methods are available.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8276 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-12-18 08:40:04 +00:00
parent 3717ff34af
commit cf5dba2beb
1 changed files with 3 additions and 1 deletions

View File

@ -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