Can't delete relation when Redmine runs in a subpath
|Assignee:||Jean-Philippe Lang||% Done:|
- 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.
Use a shallow block instead of the :shallow option that ignores routes scope (#14023).
#1 Updated by Jost Baron almost 5 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 of
- 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.
#3 Updated by Jost Baron almost 5 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 almost 5 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 almost 5 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
: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.