Bug #8638
closedDelete Host action should return /hosts instead of 404 on /hosts/delete-host.domain
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.
Updated by Tom Caspy about 10 years ago
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
Updated by Tommy McNeely about 10 years ago
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)
Updated by Tom Caspy about 10 years ago
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.
Updated by Dominic Cleal about 10 years ago
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.
Updated by Tom Caspy about 10 years ago
- 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.
Updated by Tommy McNeely about 10 years ago
Not sure if this will work...
https://docs.google.com/a/lark-it.com/file/d/0Bw8r1SqN6Yt_YmJMYXY0eVR1ZFE
Updated by Dominic Cleal about 10 years ago
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.
Updated by Dominic Cleal about 10 years ago
- Related to Bug #5773: editing resources in UI returns view to wrong page and search added
Updated by The Foreman Bot about 10 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2025 added
- Pull request deleted (
)
Updated by Dominic Cleal about 10 years ago
- Has duplicate Bug #8744: Host Not Found error in Foreman WebUI after deleting a host added
Updated by Shlomi Zadok almost 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset e29e550e8428a16276de9ac1f06efac9288eb361.
Updated by Dominic Cleal almost 10 years ago
- Translation missing: en.field_release set to 30
Updated by Stephen Benjamin almost 10 years ago
- Has duplicate Bug #9078: Redirect after host destroy not working added
Updated by Dominic Cleal almost 10 years ago
- Related to Bug #9469: Delete report success action should redirect to /reports instead of a 404 error on /reports/(report-id) added