Dynamic choice fields using query parameters clear existing values #10092

Closed
opened 2025-12-29 21:26:46 +01:00 by adam · 4 comments
Owner

Originally created by @sweston99 on GitHub (Aug 14, 2024).

Deployment Type

Self-hosted

NetBox Version

v4.0.8

Python Version

3.11

Steps to Reproduce

  1. Example is adding vlans to a tagged interface and selecting the vlans using the VLANGroup filter.
  2. Create a vlan group, e.g. "Test-VG" and add two vlans to the vlan group, e.g. vlan100 and vlan101
  3. Create a device switch, with ethernet interfaces.
  4. Enable and edit an ethernet interface on the device. Set 802.1Q mode to "Tagged", select "Test-VG" as the VLAN Group to filter, and add vlan100 as a Tagged VLAN to the interface and save.
  5. Edit the same ethernet interface on the device. vlan100 should show as an existing tagged vlan on the interface. Select "Test-VG" as the VLAN Group to filter; it immediately clears vlan100 as an existing vlan. If you don't re-add all of your existing vlans, it will clear them when you save it.

Expected Behavior

Selecting the Test-VG vlan group should not clear existing selections, existing selections should still be there.

Observed Behavior

Existing vlans were cleared. Note that this issue is not specific to this UI interface or VLANGroups or VLANs, rather it seems to be an issue with the dynamic choice fields.

Originally created by @sweston99 on GitHub (Aug 14, 2024). ### Deployment Type Self-hosted ### NetBox Version v4.0.8 ### Python Version 3.11 ### Steps to Reproduce 1. Example is adding vlans to a tagged interface and selecting the vlans using the VLANGroup filter. 2. Create a vlan group, e.g. "Test-VG" and add two vlans to the vlan group, e.g. vlan100 and vlan101 3. Create a device switch, with ethernet interfaces. 4. Enable and edit an ethernet interface on the device. Set 802.1Q mode to "Tagged", select "Test-VG" as the VLAN Group to filter, and add vlan100 as a Tagged VLAN to the interface and save. 5. Edit the same ethernet interface on the device. vlan100 should show as an existing tagged vlan on the interface. Select "Test-VG" as the VLAN Group to filter; it immediately clears vlan100 as an existing vlan. If you don't re-add all of your existing vlans, it will clear them when you save it. ### Expected Behavior Selecting the Test-VG vlan group should not clear existing selections, existing selections should still be there. ### Observed Behavior Existing vlans were cleared. Note that this issue is not specific to this UI interface or VLANGroups or VLANs, rather it seems to be an issue with the dynamic choice fields.
adam added the type: bugstatus: needs ownerpending closurenetboxseverity: low labels 2025-12-29 21:26:46 +01:00
adam closed this issue 2025-12-29 21:26:47 +01:00
Author
Owner

@arthanson commented on GitHub (Aug 15, 2024):

This is basically the same as #17105 - leaving this open as well as it needs to be tested when that is fixed.

@arthanson commented on GitHub (Aug 15, 2024): This is basically the same as #17105 - leaving this open as well as it needs to be tested when that is fixed.
Author
Owner

@zndrr commented on GitHub (Sep 16, 2024):

Hi Team, as an FYI, I have experienced this behaviour in custom scripts on v4.0.11; specifically with fields utilising query_params that reference other fields on the script form.
Sorry, have yet to determine full scope of our issue. I know that one script is unusuable as configured.

@zndrr commented on GitHub (Sep 16, 2024): Hi Team, as an FYI, I have experienced this behaviour in custom scripts on v4.0.11; specifically with fields utilising query_params that reference other fields on the script form. Sorry, have yet to determine full scope of our issue. I know that one script is unusuable as configured.
Author
Owner

@github-actions[bot] commented on GitHub (Apr 24, 2025):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Apr 24, 2025): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/main/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (May 25, 2025):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (May 25, 2025): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10092