I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Bug #ISSUE-12

No route matches error for journals#new

Added by Andriy Lesyuk about 8 years ago. Updated about 7 years ago.

Status:
Deferred
Priority:
Major
Assignee:
Target version:
-
Start date:
Due date:
% Done:

50%

Redmine version:
3.3.x
External issue:

Description

Before Rails 4 it was possible to override name routes in config/routes.rb. But, in Rails 4 this is no longer possible, see source:config/routes.rb@21#L12.

For Rails 4.1 it was possible to override the path helper method by including a custom module as follows:

Rails.application.routes.url_helpers.send(:include, IssueRouterHelper)

But, in Rails 4.2 this does not work as well. Redmine gives the error:

No route matches {:action⇒“new”, :controller⇒“journals”, :id⇒#<Issue id: 273, ..., project_key: “ADMIN”, issue_number: 8>} missing required keys: [:id]

I tried different methods including something like (found such on StackOverflow):

Rails.application.routes.named_routes.url_helpers_module.send(:include, IssueRouterHelper)

But, no luck.

Currently, this is fixed by overriding app/views/issues/show.html.erb (see r23), but this is not a good workaround. A better one should be found! I assume, Rails 4.3+ should have a fix for this.


Related issues

Related to ISSUE-id - Bug #ISSUE-8: Errors when used with redmine 3 Closed 10 Apr 2015 07 Dec 2017

Associated revisions

Revision 23 (diff)
Added by Andriy Lesyuk about 8 years ago

Fix #quoted_issue_path by overriding issues/show.html.erb (#ISSUE-8, #ISSUE-12)

Revision 24 (diff)
Added by Andriy Lesyuk about 8 years ago

Made show.html.erb backward compatible (#ISSUE-12)

Revision 27 (diff)
Added by Andriy Lesyuk about 7 years ago

Fixes for Redmine 3.3 (#ISSUE-8 and #ISSUE-12, #ISSUE-9 and #ISSUE-13)

History

#1 Updated by Andriy Lesyuk about 8 years ago

  • Related to Bug #ISSUE-8: Errors when used with redmine 3 added

#2 Updated by Andriy Lesyuk about 8 years ago

  • Description updated (diff)

#3 Updated by Andriy Lesyuk about 7 years ago

  • Status changed from Incomplete to In Progress
  • Target version set to 0.0.2
  • Redmine version set to 3.3.x

Got this error again - in #render_notes. That’s because #render_notes now calls #quoted_issue_path.

#4 Updated by Andriy Lesyuk about 7 years ago

  • Priority changed from Normal to Major

#5 Updated by Andriy Lesyuk about 7 years ago

  • % Done changed from 0 to 50

#6 Updated by Andriy Lesyuk about 7 years ago

  • Status changed from In Progress to Deferred
  • Target version deleted (0.0.2)

This was fixed in 0.0.2, but I don’t like the way, it was fixed, so leaving this ticket open.

Currently, as it was mentioned above, it was fixed by overriding issues’ show.html.erb and monkey-patching #render_notes. The proper fix would be to override the route only, but this is not currently allowed by Rails, what, I believe, should change in future (maybe, in 4.3+).

Also available in: Atom PDF

Terms of use | Privacy policy