Project

General

Profile

Actions

Bug #11304

open

Editing subnet redirects to New Host form if used simultaneously

Added by Dominic Cleal over 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Web Interface
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

1. Open up the Subnets index page
2. Open up the New Host form in a separate tab
3. Select a subnet in the New Host form with IP suggestions, which should populate
4. Select a subnet to edit on the Subnet index
5. Save the subnet

It will redirect the two pane page to /hosts/new, so you end up with an embedded New Host form in the pane (see screenshot).

2015-08-06T08:51:51 [app] [I] Started PUT "/subnets/7-libvirt%203" for 127.0.0.1 at 2015-08-06 08:51:51 +0100
2015-08-06T08:51:51 [app] [I] Processing by SubnetsController#update as */*
2015-08-06T08:51:51 [app] [I]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"rO7+DbD+3h1/Pk5qZ2s+L4bmY6a80mzRHXgU7YDsJGA=", "subnet"=>{"name"=>"libvirt 3", "network"=>"192.168.122.0", "mask"=>"255.255.255.0", "gateway"=>"192.168.122.1", "dns_primary"=>"192.168.122.1",
 "dns_secondary"=>"", "ipam"=>"DHCP", "from"=>"", "to"=>"", "vlanid"=>"", "boot_mode"=>"DHCP", "domain_ids"=>[""], "dhcp_id"=>"", "tftp_id"=>"", "dns_id"=>""}, "redirect"=>"", "id"=>"7-libvirt 3"}
...
2015-08-06T08:51:51 [app] [I] Redirected to http://0.0.0.0:3000/hosts/new
2015-08-06T08:51:51 [app] [I] Completed 302 Found in 17.7ms (ActiveRecord: 1.1ms)

What appears to be happening is that the AJAX request on the New Host form hits the subnet controller, which triggers the store_redirect_to_url filter in app/controllers/concerns/foreman/controller/auto_complete_search.rb. The filter should probably only store the URL if !ajax?.

This might happen with other controllers, such as images which is used for CRs in the New Host form.


Files


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #5773: editing resources in UI returns view to wrong page and searchClosedJoseph Magen05/17/2014Actions
Actions #1

Updated by Dominic Cleal over 8 years ago

  • Related to Bug #5773: editing resources in UI returns view to wrong page and search added
Actions

Also available in: Atom PDF