Lists aren't loaded completely in Edit mode resulting in empty fields #5259

Closed
opened 2025-12-29 19:25:59 +01:00 by adam · 1 comment
Owner

Originally created by @cs-1 on GitHub (Aug 31, 2021).

Originally assigned to: @thatmattlove on GitHub.

NetBox version

v3.0.0

Python version

3.8

Steps to Reproduce

This example shows the behaviour for sites. However, as far as we can tell, this behaviour can be observed for any data that's entered via dropdown lists in any Edit view.

  1. Open an existing rack which has a site properly assigned to it.
  2. Click the "Edit" button to edit the site.

Expected Behavior

The site information that is already there is retained and when clicking "Save", the existing site is not modified.

Observed Behavior

After clicking "Edit", the formerly assigned site disappears and the in the edit view the Site field is empty (the site needs to be re-assigned). This happens for any site that isn't loaded immediately when opening the site list in the dropdown menu. This bug does not occur for sites that are loaded immediately.

When opening the drop down to select the site that was originally assigned the site is missing from the list when scrolling through it (only a portion of the complete list of sites is loaded). Only after scrolling down through the whole list and scrolling back up, all sites are properly loaded in the background (you can actually see how the site list is loaded in the background). It looks like it's an issue with loading the complete site list when entering the Edit view. As mentioned before, this bug can't be observed if the site is among the list of sites that can actually be viewed in the first pass when scrolling through the site list. It only occurs when the site is among those that hasn't been loaded on first pass. This bug also occurs in any other Edit view (e. g. Device Edit view) where the site list is loaded.

Important: This bug is not limited to sites! It also occurs for access VLANs when editing interfaces! If a VLAN is selected that is at the end of the list that is loaded in the dropdown menu and which is only dynamically loaded when scrolling through the menu, saving the interface and re-clicking Edit will yield in an empty access VLAN field!

Originally created by @cs-1 on GitHub (Aug 31, 2021). Originally assigned to: @thatmattlove on GitHub. ### NetBox version v3.0.0 ### Python version 3.8 ### Steps to Reproduce This example shows the behaviour for sites. However, as far as we can tell, this behaviour can be observed for any data that's entered via dropdown lists in any Edit view. 1. Open an existing rack which has a site properly assigned to it. 2. Click the "Edit" button to edit the site. ### Expected Behavior The site information that is already there is retained and when clicking "Save", the existing site is not modified. ### Observed Behavior After clicking "Edit", the formerly assigned site disappears and the in the edit view the Site field is empty (the site needs to be re-assigned). This happens for any site that isn't loaded immediately when opening the site list in the dropdown menu. This bug does not occur for sites that are loaded immediately. When opening the drop down to select the site that was originally assigned the site is missing from the list when scrolling through it (only a portion of the complete list of sites is loaded). Only after scrolling down through the whole list and scrolling back up, all sites are properly loaded in the background (you can actually see how the site list is loaded in the background). It looks like it's an issue with loading the complete site list when entering the Edit view. As mentioned before, this bug can't be observed if the site is among the list of sites that can actually be viewed in the first pass when scrolling through the site list. It only occurs when the site is among those that hasn't been loaded on first pass. This bug also occurs in any other Edit view (e. g. Device Edit view) where the site list is loaded. **Important:** This bug is not limited to sites! It also occurs for access VLANs when editing interfaces! If a VLAN is selected that is at the end of the list that is loaded in the dropdown menu and which is only dynamically loaded when scrolling through the menu, saving the interface and re-clicking Edit will yield in an empty access VLAN field!
adam added the type: bugstatus: accepted labels 2025-12-29 19:25:59 +01:00
adam closed this issue 2025-12-29 19:25:59 +01:00
Author
Owner

@rodvand commented on GitHub (Aug 31, 2021):

I'm able to reproduce this on my instance. If I check my developer tools for the request being made I see <my netbox url>/api/dcim/devices/locations/?brief=true&site_id=2137 and this returns a count of 0 items. So there seems to be something with the reverse lookup using site_id in the query which fails to return the item (maybe a limit applied by default?).

@rodvand commented on GitHub (Aug 31, 2021): I'm able to reproduce this on my instance. If I check my developer tools for the request being made I see `<my netbox url>/api/dcim/devices/locations/?brief=true&site_id=2137` and this returns a count of 0 items. So there seems to be something with the reverse lookup using `site_id` in the query which fails to return the item (maybe a limit applied by default?).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5259