Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix unsetting the @project_scope instance variable

Oliver Günther558c4b314ba2
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb
index a62b8c0cc54..19906009d4e 100644
--- a/lib/redmine/plugin.rb
+++ b/lib/redmine/plugin.rb
@@ -331,13 +331,13 @@ module Redmine #:nodoc:
# permission :destroy_contacts, { contacts: :destroy }
# end
def project_module(name, options = {}, &block)
- @project_scope = [name, options]
plugin = self
Rails.application.reloader.to_prepare do
+ plugin.instance_eval { @project_scope = [name, options] }
plugin.instance_eval(&block)
end
ensure
- @project_scope = nil
+ plugin.instance_eval { @project_scope = nil }
end
# Registers an activity provider.