Defect #14023

Can't delete relation when Redmine runs in a subpath

Added by Ralf S. over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues
Target version:2.3.2
Resolution:Fixed Affected version:2.3.0

Description

Brief Description:
  • Since update to V2.3.0, it's not possible to delete a related issue.
  • this worked very well in former versions
Reproduce Hints:
  1. open a Ticket view, go down to 'Related issues' and [Add] an issue
  2. select 'Related to', type another valid ticket no. of same project and [Add] => everything ok!
  3. Now try to [Delete Relation] of that issue in same view
  4. Dialog 'Are you sure?', press [Ok] => relation is still active!
Notes:
  • We tryed a lot, but did not find a workaround for that bug.
  • The bug exists in V2.3.1 too.
  • 'Related Issues' is a powerful feature in Redmine. So we hope, that somebody improves the priority of this defect for next release V2.3.2.

Associated revisions

Revision 11851
Added by Jean-Philippe Lang over 4 years ago

Use a shallow block instead of the :shallow option that ignores routes scope (#14023).

Revision 11871
Added by Jean-Philippe Lang over 4 years ago

Merged r11851 from trunk (#14023).

History

#1 Updated by Jost Baron over 4 years ago

This seems to be a problem triggered by running redmine in a subpath. To make redmine run in the subpath "/redmine", two things were done:

  1. The line Redmine::Utils::relative_url_root = "/redmine" was added as last line of config/environment.rb
  2. The workaround described here was used.

This adds the prefix "/redmine" to all links, but it misses the "Remove relation" link. However, even after adding the prefix, redmine can't route the DELETE-request: ActionController::RoutingError (No route matches [DELETE] "/redmine/relations/123456").

Hope this helps in fixing it.

#2 Updated by Jean-Philippe Lang over 4 years ago

  • Subject changed from Can't delete relation to Can't delete relation when Redmine runs in a subpath

#3 Updated by Jost Baron over 4 years ago

This may be considered as resolved.

The problem was that routes to relations are shallow routes and the variable :shallow_path was not set accordingly. It would be nice if redmine would work in subdirectories again. Using a reverse proxy sadly is no option, because some paths are hardcoded into JS, which makes them hard to adjust.

I've posted an attempt of a solution here, but that is probably not the best way of resolving the issue.

#4 Updated by Jean-Philippe Lang over 4 years ago

According to http://stackoverflow.com/questions/6422677/rails-routes-with-scope-locale-and-shallow-nested-resources, you should be able to specify :shallow_path only once with your scope (not tested):

scope :path => "redmine", :shallow_path => "redmine" do
  ...
end

IIRC, there was no need to change the routes with Rails 2 for running in a suburi.

#5 Updated by Jean-Philippe Lang over 4 years ago

  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.3.2
  • Resolution set to Fixed

While using :shallow => true ignores the scope, using a shallow block takes care of it. I'm not sure that it's an expected behaviour from Rails but I've committed the change in r11851. Wrapping the routes in a single scope now generates all routes with that scope properly.

#6 Updated by Jean-Philippe Lang over 4 years ago

  • Status changed from Resolved to Closed

Merged.

Also available in: Atom PDF