Bug #25976
closedbookmarks and autocompletion don't work for nested controller
Description
auto_complete_controller_name
helper is used to determine both which controller to use for the auto_completion, as well as a value for bookmarks.controller
attribute. In bookmarks, we test the controller to match the database table.
In #24040, the code send("#{auto_complete_controller_name}_path")
(https://github.com/iNecas/foreman/commit/184f8d5ce23cfe208a696535bcea346074d8600a#diff-120a1c3293b2d4c051433c4f2c8a7a3bL1) was replaced with url: "#{auto_complete_controller_name}/auto_complete_search"
, so we suddenly started to assume that auto_complete_controller_name
will automatically match the controller_path
, which is not the case with nested controller (that we have in foreman_tasks).
As a result, we've hit https://projects.theforeman.org/issues/25427 and https://projects.theforeman.org/issues/25958/.
I think the solution should be to get the auto_complete_controller_name
the meaning it had before #24040, so not assuming path where we expect the controller name, and use the Rails path helpers to determine the right url. This way, we can also check better that the autocomplete url is actually defined.
Updated by Ivan Necas almost 6 years ago
- Related to Feature #24040: Move the search box in Hardware Models to a React component added
Updated by Ivan Necas almost 6 years ago
- Related to Bug #25427: "Request failed with status code 404" error on Tasks page added
Updated by Ivan Necas almost 6 years ago
- Related to Bug #25958: Bookmarks not working on Monitor > Tasks page added
Updated by The Foreman Bot almost 6 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/6460 added
Updated by Ivan Necas almost 6 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 548c23f1280ec8ee48d40c0e0bf4f9ccbe960e5f.