summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-18 08:40:04 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-18 08:40:04 +0000
commitcf5dba2beb876cf17442d6c838b7eeb8d7c83a05 (patch)
treef2e54136dc4f43ecada1e9c3d13b1a9c3b19e4d4 /lib
parent3717ff34afda47c02d5a6cc07bb14d049ebe18c6 (diff)
downloadredmine-cf5dba2beb876cf17442d6c838b7eeb8d7c83a05.tar.gz
redmine-cf5dba2beb876cf17442d6c838b7eeb8d7c83a05.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/hook.rb4
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