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

avoid naming conflicts when patching

ulferts2aac9920c1a1
diff --git a/lib/open_project/plugins/acts_as_op_engine.rb b/lib/open_project/plugins/acts_as_op_engine.rb
index 5dbae38a845..97b63593d83 100644
--- a/lib/open_project/plugins/acts_as_op_engine.rb
+++ b/lib/open_project/plugins/acts_as_op_engine.rb
@@ -119,7 +119,11 @@ module OpenProject::Plugins
plugin_module = self.class.to_s.deconstantize
self.class.config.to_prepare do
klass_name = args.last
- patch = "#{plugin_module}::Patches::#{klass_name}Patch".constantize
+ patch = begin
+ "#{plugin_module}::Patches::#{args[0..-2].join('::')}::#{klass_name}Patch".constantize
+ rescue NameError
+ "#{plugin_module}::Patches::#{klass_name}Patch".constantize
+ end
qualified_class_name = args.map(&:to_s).join('::')
klass = qualified_class_name.to_s.constantize
klass.send(:include, patch) unless klass.included_modules.include?(patch)