Defect #26506
closedUser link syntax causes an exception while sending email notification on Rails 5.1
0%
Description
Steps to reproduce:
- Open "New issue" page.
- Enter something in the subject field.
- Enter "@admin" in the description field.
- Press "Create" button. You will see "NoMethodError" exception (please see the attached screenshot).
Affected version: r16859 and later
Files
Related issues
Updated by Marius BĂLTEANU over 7 years ago
Indeed, I'm able to reproduce the issue, but I'm not sure how to fix it.
Updated by Marius BĂLTEANU over 7 years ago
Adding "include Rails.application.routes.url_helpers" to ApplicationHelper fixes the issue, but still I'm not sure that is the best solution.
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index e14cff2..e28a446 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -29,6 +29,7 @@ module ApplicationHelper
include Redmine::Themes::Helper
include Redmine::Hook::Helper
include Redmine::Helpers::URL
+ include Rails.application.routes.url_helpers
extend Forwardable
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
Updated by Go MAEDA over 7 years ago
Marius BALTEANU wrote:
Adding "include Rails.application.routes.url_helpers" to ApplicationHelper fixes the issue, but still I'm not sure that is the best solution.
[...]
The issue was fixed by your patch.
Thank you for inspecting it so quickly.
Updated by Go MAEDA over 7 years ago
Go MAEDA wrote:
Marius BALTEANU wrote:
Adding "include Rails.application.routes.url_helpers" to ApplicationHelper fixes the issue, but still I'm not sure that is the best solution.
[...]
The issue was fixed by your patch.
Unfortunately some tests fail because of the fix.
Updated by Jean-Philippe Lang over 7 years ago
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
- Target version deleted (
4.0.0) - Resolution set to Fixed
This should be fixed in r16876 by using _url
helper instead of _path
like in other link_to_
methods. It also fixed that generated links to users were missing the host name.
Updated by Jean-Philippe Lang over 7 years ago
- Related to Feature #23630: Migrate to Rails 5.2 added
Updated by Marius BĂLTEANU over 7 years ago
Jean-Philippe Lang wrote:
This should be fixed in r16876 by using
_url
helper instead of_path
like in otherlink_to_
methods. It also fixed that generated links to users were missing the host name.
Thanks Jean-Philippe Lang for fixing this issue.
Updated by Andriy Lesyuk almost 7 years ago
Without this change user links in emails are invalid (as they are relative), so please include it into the very next release.