Filter option in Cable List view requires blank value #2442

Closed
opened 2025-12-29 18:18:54 +01:00 by adam · 1 comment
Owner

Originally created by @Grokzen on GitHub (Mar 6, 2019).

Environment

  • Python version: 3.6.x
  • NetBox version: 2.5.8-dev (commit 7294f43f)

Steps to Reproduce

The Type filter option in the Cable list view needs to have a blank value added. Currently it defaults to the first option of the available cable types and when i press apply without filling in any fields it will use CAT-3 as the filter for type and in the case i do not have any cable types with CAT-3 it will show a empty list of cables.

Expected Behavior

Without making any choices of any field i would expect it to show all available items in the list view. The solution is to add add_blank_choice(...) to the CableFilterForm.type choicefield

Observed Behavior

The first cable type is always selected and in the case i do not have any of that type it will filter out all items.

To solve this issue i have to every time before i use apply i would have to press the Clear X for that field to set it to null so that it do not add that field to the URL request for filter.

Originally created by @Grokzen on GitHub (Mar 6, 2019). <!-- NOTE: This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.6.x <!-- Example: 3.5.4 --> * NetBox version: 2.5.8-dev (commit 7294f43f) <!-- Example: 2.5.2 --> <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox (or the current beta release where applicable). Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a wrapper like pynetbox. --> ### Steps to Reproduce The `Type` filter option in the Cable list view needs to have a blank value added. Currently it defaults to the first option of the available cable types and when i press apply without filling in any fields it will use CAT-3 as the filter for type and in the case i do not have any cable types with CAT-3 it will show a empty list of cables. <!-- What did you expect to happen? --> ### Expected Behavior Without making any choices of any field i would expect it to show all available items in the list view. The solution is to add `add_blank_choice(...)` to the `CableFilterForm.type` choicefield <!-- What happened instead? --> ### Observed Behavior The first cable type is always selected and in the case i do not have any of that type it will filter out all items. To solve this issue i have to every time before i use apply i would have to press the `Clear X` for that field to set it to null so that it do not add that field to the URL request for filter.
adam closed this issue 2025-12-29 18:18:54 +01:00
Author
Owner

@Grokzen commented on GitHub (Mar 6, 2019):

My error, had wrong build enabled and saw this was fixed in 2.5.7 already

@Grokzen commented on GitHub (Mar 6, 2019): My error, had wrong build enabled and saw this was fixed in 2.5.7 already
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2442