Closed
Description
Deployment Type
Self-hosted
NetBox Version
v4.0.6
Python Version
3.10
Steps to Reproduce
- Click "Devices"->"Device Components"->"Interfaces"
- Try to search for a number of interfaces on a number of switches that all need to be configured the same way
- Fail using the UI, modify URL to contain multiple mentions of "name" and "device" like so:
https://netbox.selfhosted/dcim/interfaces/?device=dc-l1-3-leaf1&device=dc-l1-3-leaf2&name=1/21&name=1/22&name=1/23&name=1/24
- Successfully be presented with required list of Ports across multiple switches and select all of them
- Click on "Edit selected"
- Receive a 500 server error
Expected Behavior
A Bulk edit page should have opened for the selected ports
Observed Behavior
<class 'ValueError'>
Field 'id' expected a number but got 'dc-l1-3-leaf2'.
is reported
Additional Context
The request contains the list of pk
s for the selected interfaces as "Form data".
Inspecting the "Edit selected" button, I noticed that formaction
for _rename
Button doesn't contain parameters from the URL, while formaction
for _edit
(and _delete
) Button contains full URL including manually added parameters:
<button type="submit" name="_edit" formaction="/dcim/interfaces/edit/?device=dc-l1-3-leaf1&device=dc-l1-3-leaf2&name=1%2F21&name=1%2F22&name=1%2F23&name=1%2F24" class="btn btn-yellow">
<i class="mdi mdi-pencil" aria-hidden="true"></i> Edit Selected
</button>
<button type="submit" name="_rename" formaction="/dcim/interfaces/rename/" class="btn btn-outline-warning">
<i class="mdi mdi-pencil-outline" aria-hidden="true"></i> Rename Selected
</button>
<button type="submit" name="_delete" formaction="/dcim/interfaces/delete/?device=dc-l1-3-leaf1&device=dc-l1-3-leaf2&name=1%2F21&name=1%2F22&name=1%2F23&name=1%2F24" class="btn btn-red">
<i class="mdi mdi-trash-can-outline" aria-hidden="true"></i> Delete Selected
</button>
I modified the form action on the fly to remove the additional parameters and the button worked as expected - a bulk edit form was opened and the changes were applied to all selected interfaces. I also was returned to the search result page/URL with additional parameters as expected, so I could see the changes on the selected interfaces