Bug #8638
closed
Delete Host action should return /hosts instead of 404 on /hosts/delete-host.domain
Added by Tommy McNeely about 10 years ago.
Updated over 6 years ago.
Description
When I use the big red "Delete" button to remove a VM that was created, it is successful, but it tried to return to the same page (/hosts/delete-me.domain.com) instead of just going back to /hosts. This causes a "host not found" (404) error.
- Category set to Web Interface
- Assignee set to Tom Caspy
which version of foreman are you using? I just tested it manually and it works.
it's also automatically tested in hosts_controller_test.rb:93
I am using 1.7.0, and if it matters, my VM is in the "Digital Ocean" Compute Resource...
- Hosts -> All Hosts
- Click a Host to bring up the "host show" details
- on the hosts screen I am generally clicking around (tabs on the left), but I doubt that matters
- Click the Delete button at the top
- Get a "Host Not Found" page (url is /hosts/system-i-deleted.domain.com)
ok, this should be fixed in 1.8.0, as I've tested this and it works as expected in the develop version of 1.8.0, I guess it was fixed along the way.
Very little has changed between 1.7 and 1.8 at the moment, and I can't think of such a change off the top of my head.
- Assignee deleted (
Tom Caspy)
that's odd. there's a test for that, and I've actually replicated the same exact conditions (deleting a host in digital ocean) and it worked as expected.
I'm removing myself from this ticket, as I could not reproduce it.
That worked, thanks. We also just had Dw_Sn on IRC with the same problem, so investigated it a bit further.
I think what's happening is due to #5773, as when you click the link to destroy, the show page is sent as the referrer. https://github.com/theforeman/foreman/blob/1.7.0/app/controllers/concerns/foreman/controller/auto_complete_search.rb#L6 runs on a destroy action (it isn't excluded), so the show page gets stored as the page to redirect back to.
This is probably an issue only with hosts as I don't think other show pages have delete buttons, it's usually on the index. If we simply exclude the destroy action too, then it means if you delete a host from the index that #5773 won't work as the referrer won't be stored.
- Related to Bug #5773: editing resources in UI returns view to wrong page and search added
- Assignee set to Shlomi Zadok
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2025 added
- Pull request deleted (
)
- Has duplicate Bug #8744: Host Not Found error in Foreman WebUI after deleting a host added
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Translation missing: en.field_release set to 30
- Has duplicate Bug #9078: Redirect after host destroy not working added
- Related to Bug #9469: Delete report success action should redirect to /reports instead of a 404 error on /reports/(report-id) added
Also available in: Atom
PDF