Defect #14023
closedCan't delete relation when Redmine runs in a subpath
0%
Description
- Since update to V2.3.0, it's not possible to delete a related issue.
- this worked very well in former versions
- open a Ticket view, go down to 'Related issues' and [Add] an issue
- select 'Related to', type another valid ticket no. of same project and [Add] => everything ok!
- Now try to [Delete Relation] of that issue in same view
- Dialog 'Are you sure?', press [Ok] => relation is still active!
- 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.
Updated by Jost Baron over 11 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:
- The line
Redmine::Utils::relative_url_root = "/redmine"
was added as last line ofconfig/environment.rb
- 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.
Updated by Jean-Philippe Lang over 11 years ago
- Subject changed from Can't delete relation to Can't delete relation when Redmine runs in a subpath
Updated by Jost Baron over 11 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.
Updated by Jean-Philippe Lang over 11 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.
Updated by Jean-Philippe Lang over 11 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.