https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292017-07-24T03:43:32ZRedmineRedmine - Defect #26506: User link syntax causes an exception while sending email notification on Rails 5.1https://www.redmine.org/issues/26506?journal_id=802132017-07-24T03:43:32ZGo MAEDA
<ul><li><strong>Category</strong> set to <i>Text formatting</i></li></ul> Redmine - Defect #26506: User link syntax causes an exception while sending email notification on Rails 5.1https://www.redmine.org/issues/26506?journal_id=802152017-07-24T07:19:48ZMarius BĂLTEANU
<ul></ul><p>Indeed, I'm able to reproduce the issue, but I'm not sure how to fix it.</p> Redmine - Defect #26506: User link syntax causes an exception while sending email notification on Rails 5.1https://www.redmine.org/issues/26506?journal_id=802182017-07-24T08:05:17ZMarius BĂLTEANU
<ul></ul><p>Adding "include Rails.application.routes.url_helpers" to ApplicationHelper fixes the issue, but still I'm not sure that is the best solution.</p>
<pre><code class="diff syntaxhl"><span class="gh">diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index e14cff2..e28a446 100644
</span><span class="gd">--- a/app/helpers/application_helper.rb
</span><span class="gi">+++ b/app/helpers/application_helper.rb
</span><span class="p">@@ -29,6 +29,7 @@</span> module ApplicationHelper
include Redmine::Themes::Helper
include Redmine::Hook::Helper
include Redmine::Helpers::URL
<span class="gi">+ include Rails.application.routes.url_helpers
</span>
extend Forwardable
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
</code></pre> Redmine - Defect #26506: User link syntax causes an exception while sending email notification on Rails 5.1https://www.redmine.org/issues/26506?journal_id=802222017-07-24T10:01:37ZGo MAEDA
<ul></ul><p>Marius BALTEANU wrote:</p>
<blockquote>
<p>Adding "include Rails.application.routes.url_helpers" to ApplicationHelper fixes the issue, but still I'm not sure that is the best solution.</p>
<p>[...]</p>
</blockquote>
<p>The issue was fixed by your patch.<br />Thank you for inspecting it so quickly.</p> Redmine - Defect #26506: User link syntax causes an exception while sending email notification on Rails 5.1https://www.redmine.org/issues/26506?journal_id=802282017-07-24T12:26:16ZGo MAEDA
<ul></ul><p>Go MAEDA wrote:</p>
<blockquote>
<p>Marius BALTEANU wrote:</p>
<blockquote>
<p>Adding "include Rails.application.routes.url_helpers" to ApplicationHelper fixes the issue, but still I'm not sure that is the best solution.</p>
<p>[...]</p>
</blockquote>
<p>The issue was fixed by your patch.</p>
</blockquote>
<p>Unfortunately some tests fail because of the fix.</p>
<p><a href="#" onclick="$('#collapse-07f8823a-show, #collapse-07f8823a-hide').toggle(); $('#collapse-07f8823a').fadeToggle(150);; return false;" id="collapse-07f8823a-show" class="icon icon-collapsed collapsible">error log</a><a href="#" onclick="$('#collapse-07f8823a-show, #collapse-07f8823a-hide').toggle(); $('#collapse-07f8823a').fadeToggle(150);; return false;" id="collapse-07f8823a-hide" class="icon icon-expended collapsible" style="display:none;">error log</a><div id="collapse-07f8823a" class="collapsed-text" style="display:none;"><pre>
$ ruby test/unit/helpers/application_helper_test.rb
Run options: --seed 43089
# Running:
..............E
Error:
ApplicationHelperTest#test_due_date_distance_in_words:
TypeError: no implicit conversion of Symbol into String
app/helpers/application_helper.rb:276:in `due_date_distance_in_words'
test/unit/helpers/application_helper_test.rb:1326:in `block in test_due_date_distance_in_words'
test/unit/helpers/application_helper_test.rb:1325:in `each'
test/unit/helpers/application_helper_test.rb:1325:in `test_due_date_distance_in_words'
bin/rails test test/unit/helpers/application_helper_test.rb:1315
E
Error:
ApplicationHelperTest#test_table_of_content_should_generate_unique_anchors:
I18n::ArgumentError: Object must be a Date, DateTime or Time object. :label_table_of_contents given.
app/helpers/application_helper.rb:1130:in `block in replace_toc'
app/helpers/application_helper.rb:1120:in `gsub!'
app/helpers/application_helper.rb:1120:in `replace_toc'
app/helpers/application_helper.rb:654:in `textilizable'
test/unit/helpers/application_helper_test.rb:1206:in `test_table_of_content_should_generate_unique_anchors'
bin/rails test test/unit/helpers/application_helper_test.rb:1182
.......E
Error:
ApplicationHelperTest#test_principals_options_for_select_should_include_me_option_when_current_user_is_in_collection:
I18n::ArgumentError: Object must be a Date, DateTime or Time object. :label_me given.
app/helpers/application_helper.rb:442:in `principals_options_for_select'
test/unit/helpers/application_helper_test.rb:1462:in `test_principals_options_for_select_should_include_me_option_when_current_user_is_in_collection'
bin/rails test test/unit/helpers/application_helper_test.rb:1458
.....................E
Error:
ApplicationHelperTest#test_table_of_content_should_contain_included_page_headings:
I18n::ArgumentError: Object must be a Date, DateTime or Time object. :label_table_of_contents given.
app/helpers/application_helper.rb:1130:in `block in replace_toc'
app/helpers/application_helper.rb:1120:in `gsub!'
app/helpers/application_helper.rb:1120:in `replace_toc'
app/helpers/application_helper.rb:654:in `textilizable'
test/unit/helpers/application_helper_test.rb:1230:in `test_table_of_content_should_contain_included_page_headings'
bin/rails test test/unit/helpers/application_helper_test.rb:1212
..E
Error:
ApplicationHelperTest#test_toc_with_textile_formatting_should_be_parsed:
I18n::ArgumentError: Object must be a Date, DateTime or Time object. :label_table_of_contents given.
app/helpers/application_helper.rb:1130:in `block in replace_toc'
app/helpers/application_helper.rb:1120:in `gsub!'
app/helpers/application_helper.rb:1120:in `replace_toc'
app/helpers/application_helper.rb:654:in `textilizable'
test/unit/helpers/application_helper_test.rb:1235:in `block in test_toc_with_textile_formatting_should_be_parsed'
test/test_helper.rb:93:in `with_settings'
test/unit/helpers/application_helper_test.rb:1234:in `test_toc_with_textile_formatting_should_be_parsed'
bin/rails test test/unit/helpers/application_helper_test.rb:1233
E
Error:
ApplicationHelperTest#test_toc_with_markdown_formatting_should_be_parsed:
I18n::ArgumentError: Object must be a Date, DateTime or Time object. :label_table_of_contents given.
app/helpers/application_helper.rb:1130:in `block in replace_toc'
app/helpers/application_helper.rb:1120:in `gsub!'
app/helpers/application_helper.rb:1120:in `replace_toc'
app/helpers/application_helper.rb:654:in `textilizable'
test/unit/helpers/application_helper_test.rb:1244:in `block in test_toc_with_markdown_formatting_should_be_parsed'
test/test_helper.rb:93:in `with_settings'
test/unit/helpers/application_helper_test.rb:1243:in `test_toc_with_markdown_formatting_should_be_parsed'
bin/rails test test/unit/helpers/application_helper_test.rb:1242
.....E
Error:
ApplicationHelperTest#test_principals_options_for_select_with_users_and_groups:
I18n::ArgumentError: Object must be a Date, DateTime or Time object. :label_group_plural given.
app/helpers/application_helper.rb:450:in `principals_options_for_select'
test/unit/helpers/application_helper_test.rb:1451:in `test_principals_options_for_select_with_users_and_groups'
bin/rails test test/unit/helpers/application_helper_test.rb:1445
..........E
Error:
ApplicationHelperTest#test_table_of_content:
I18n::ArgumentError: Object must be a Date, DateTime or Time object. :label_table_of_contents given.
app/helpers/application_helper.rb:1130:in `block in replace_toc'
app/helpers/application_helper.rb:1120:in `gsub!'
app/helpers/application_helper.rb:1120:in `replace_toc'
app/helpers/application_helper.rb:654:in `textilizable'
test/unit/helpers/application_helper_test.rb:1179:in `test_table_of_content'
bin/rails test test/unit/helpers/application_helper_test.rb:1118
......E
Error:
ApplicationHelperTest#test_section_edit_links:
I18n::ArgumentError: Object must be a Date, DateTime or Time object. :button_edit_section given.
app/helpers/application_helper.rb:1031:in `block in parse_sections'
app/helpers/application_helper.rb:1026:in `gsub!'
app/helpers/application_helper.rb:1026:in `parse_sections'
app/helpers/application_helper.rb:645:in `textilizable'
test/unit/helpers/application_helper_test.rb:1276:in `test_section_edit_links'
bin/rails test test/unit/helpers/application_helper_test.rb:1251
.....................E
Error:
ApplicationHelperTest#test_hours_formatting:
I18n::ArgumentError: Object must be a Date, DateTime or Time object. :label_f_hour_short given.
lib/redmine/i18n.rb:52:in `l_hours_short'
test/unit/helpers/application_helper_test.rb:1594:in `block in test_hours_formatting'
test/test_helper.rb:93:in `with_settings'
test/unit/helpers/application_helper_test.rb:1592:in `test_hours_formatting'
bin/rails test test/unit/helpers/application_helper_test.rb:1589
............
Finished in 4.059187s, 26.6063 runs/s, 91.6440 assertions/s.
108 runs, 372 assertions, 0 failures, 10 errors, 0 skips
</pre></div></p> Redmine - Defect #26506: User link syntax causes an exception while sending email notification on Rails 5.1https://www.redmine.org/issues/26506?journal_id=802382017-07-24T17:00:53ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li><li><strong>Target version</strong> deleted (<del><i>4.0.0</i></del>)</li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>This should be fixed in <a class="changeset" title="Fixed link to user in email notifications (#26506)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/16876">r16876</a> by using <code>_url</code> helper instead of <code>_path</code> like in other <code>link_to_</code> methods. It also fixed that generated links to users were missing the host name.</p> Redmine - Defect #26506: User link syntax causes an exception while sending email notification on Rails 5.1https://www.redmine.org/issues/26506?journal_id=802392017-07-24T17:01:06ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/23630">Feature #23630</a>: Migrate to Rails 5.2</i> added</li></ul> Redmine - Defect #26506: User link syntax causes an exception while sending email notification on Rails 5.1https://www.redmine.org/issues/26506?journal_id=802412017-07-24T17:11:55ZMarius BĂLTEANU
<ul></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>This should be fixed in <a class="changeset" title="Fixed link to user in email notifications (#26506)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/16876">r16876</a> by using <code>_url</code> helper instead of <code>_path</code> like in other <code>link_to_</code> methods. It also fixed that generated links to users were missing the host name.</p>
</blockquote>
<p>Thanks Jean-Philippe Lang for fixing this issue.</p> Redmine - Defect #26506: User link syntax causes an exception while sending email notification on Rails 5.1https://www.redmine.org/issues/26506?journal_id=840202018-03-16T11:43:04ZAndriy Lesyuk
<ul></ul><p>Without this change user links in emails are invalid (as they are relative), so please include it into the very next release.</p>