Unable to sort prefixes by VLAN name/ID (regardless of site) #10595

Closed
opened 2025-12-29 21:33:30 +01:00 by adam · 1 comment
Owner

Originally created by @markkuleinio on GitHub (Dec 30, 2024).

Originally assigned to: @bctiemann on GitHub.

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.10

Python Version

3.11

Steps to Reproduce

  1. Create two sites: Site1 and Site2
  2. Create two VLANs for Site1: 111 (VLAN111) and 222 (VLAN222)
  3. Create two VLANs for Site2: 111 (VLAN111) and 222 (VLAN222)
  4. Create four prefixes:
    1. 10.1.111.0/24, Site1, VLAN111
    2. 10.1.222.0/24, Site1, VLAN222
    3. 10.2.111.0/24, Site2, VLAN111
    4. 10.2.222.0/24, Site2, VLAN222
  5. Go to Prefixes list and click the VLAN column to sort the prefixes by VLAN

Expected Behavior

The prefixes are shown sorted by the VLAN name/ID (as shown in the VLAN column).

Observed Behavior

The prefixes are shown sorted by some other data, not by the data shown in the VLAN column:

image

Originally created by @markkuleinio on GitHub (Dec 30, 2024). Originally assigned to: @bctiemann on GitHub. ### Deployment Type Self-hosted ### Triage priority N/A ### NetBox Version v4.1.10 ### Python Version 3.11 ### Steps to Reproduce 1. Create two sites: **Site1** and **Site2** 2. Create two VLANs for **Site1**: 111 (VLAN111) and 222 (VLAN222) 3. Create two VLANs for **Site2**: 111 (VLAN111) and 222 (VLAN222) 4. Create four prefixes: 1. 10.1.111.0/24, **Site1**, VLAN111 2. 10.1.222.0/24, **Site1**, VLAN222 3. 10.2.111.0/24, **Site2**, VLAN111 4. 10.2.222.0/24, **Site2**, VLAN222 5. Go to Prefixes list and click the VLAN column to sort the prefixes by VLAN ### Expected Behavior The prefixes are shown sorted by the VLAN name/ID (as shown in the VLAN column). ### Observed Behavior The prefixes are shown sorted by some other data, not by the data shown in the VLAN column: ![image](https://github.com/user-attachments/assets/75ffcf29-a408-45d2-8585-0e7065664817)
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:33:30 +01:00
adam closed this issue 2025-12-29 21:33:31 +01:00
Author
Owner

@bctiemann commented on GitHub (Jan 7, 2025):

This can be addressed either by changing the PrefixTable.vlan field to represent the numeric VLAN ID rather than the Site-scoped VLAN obejct, or by adding another field to the table for that purpose in addition to keeping the existing VLAN field. I've posted a PR that does the former, but I'd like to gather some feedback about whether this would disrupt existing workflows or would be an appropriate and minimally cluttering change.

@bctiemann commented on GitHub (Jan 7, 2025): This can be addressed either by changing the `PrefixTable.vlan` field to represent the numeric VLAN ID rather than the Site-scoped VLAN obejct, or by adding another field to the table for that purpose in addition to keeping the existing VLAN field. I've posted a PR that does the former, but I'd like to gather some feedback about whether this would disrupt existing workflows or would be an appropriate and minimally cluttering change.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10595