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 rails bug of using url_helpers outside of controller context

Dombi Attilac4e4aadc05dd
diff --git a/lib/open_project/static_routing.rb b/lib/open_project/static_routing.rb
index c51b4140158..d607b5cbaac 100644
--- a/lib/open_project/static_routing.rb
+++ b/lib/open_project/static_routing.rb
@@ -37,9 +37,11 @@ module OpenProject
# Most importantly it does work for the '#{model}_path|url' helpers, though.
module UrlHelpers
extend ActiveSupport::Concern
- include Rails.application.routes.url_helpers
included do
+ # See https://github.com/rails/rails/pull/50403
+ include Rails.application.routes.url_helpers
+
def default_url_options
options = ActionMailer::Base.default_url_options.clone