Project

General

Profile

Bug #25976

bookmarks and autocompletion don't work for nested controller

Added by Ivan Necas 4 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

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.


Related issues

Related to Foreman - Feature #24040: Move the search box in Hardware Models to a React componentClosed
Related to foreman-tasks - Bug #25427: "Request failed with status code 404" error on Tasks pageClosed
Related to foreman-tasks - Bug #25958: Bookmarks not working on Monitor > Tasks pageClosed

Associated revisions

Revision 548c23f1 (diff)
Added by Ivan Necas 4 months ago

Fixes #25976 - use path helper to determine auto-completion path

Commit 184f8d5ce2 changed the meaning of the
auto_complete_controller_name and assumed it will always equal to the
path, which is not the case for nested controllers (that we have
for example in foreman-tasks). As a result, this feature has been broken
there.

This commit adds back the original behavior + makes sure the
auto_complete_search is actually defined, so that we detect the missing
path sooner.

History

#1 Updated by Ivan Necas 4 months ago

  • Found in Releases 1.20.0 added

#2 Updated by Ivan Necas 4 months ago

  • Related to Feature #24040: Move the search box in Hardware Models to a React component added

#3 Updated by Ivan Necas 4 months ago

  • Related to Bug #25427: "Request failed with status code 404" error on Tasks page added

#4 Updated by Ivan Necas 4 months ago

  • Related to Bug #25958: Bookmarks not working on Monitor > Tasks page added

#5 Updated by The Foreman Bot 4 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6460 added

#6 Updated by Timo Goebel 4 months ago

  • Fixed in Releases 1.22.0 added

#7 Updated by Ivan Necas 4 months ago

  • Status changed from Ready For Testing to Closed

#8 Updated by Ondřej Pražák 3 months ago

  • Bugzilla link set to 1684291

#9 Updated by Tomer Brisker about 2 months ago

  • Category set to Web Interface

Also available in: Atom PDF