redmine_dmsf icon indicating copy to clipboard operation
redmine_dmsf copied to clipboard

Mailer partial causes deprecation warning: Rendering actions with '.' in the name is deprecated

Open liaham opened this issue 11 months ago • 0 comments

Especially when running test, redmine_dmsf gives a deprecation warning:

DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated: /path/to/redmine/plugins/redmine_dmsf/app/views/mailer/../../../../../app/views/mailer/_issue.text.erb (called from block in find_all at /path/to/redmine/config/initializers/10-patches.rb:60)

The reason for this warning is this line of code in app/views/mailer/_issue.html.erb:

<%= render partial: "/#{File.dirname(__FILE__)}/../../../../../app/views/mailer/issue.html.erb",
           locals: { issue: issue, issue_url: issue_url, user: user } %>

Writing pathes to partials with '.' in the file name is deprecated since Rails 6.1 and will raise a MissingTemplate with Rails 7.0 (see https://github.com/rails/rails/pull/38858#issuecomment-871748632).

liaham avatar Mar 22 '24 17:03 liaham