Object Type Filter is ignored in Custom Links & Saved Filters #11853

Closed
opened 2025-12-29 21:50:43 +01:00 by adam · 2 comments
Owner

Originally created by @pheus on GitHub (Nov 19, 2025).

Originally assigned to: @pheus on GitHub.

NetBox Edition

NetBox Community

NetBox Version

v4.4.6

Python Version

3.12

Steps to Reproduce

  1. Go to Extras → Custom Links (/extras/custom-links/).
  2. In the filter form, pick an object/model type and click Apply.
  3. Note that the results aren’t constrained as expected.
  4. Inspect the URL/query string: the form submits object_type=<...>.
  5. Repeat the same flow under Extras → Saved Filters (/extras/saved-filters/) with the object/model type filter and observe the same behavior.

Expected Behavior

Selecting an object/model type in the filter form should narrow the list to items tied to that ContentType. The filter should submit object_type_id=<content_type_id> so the underlying filterset receives the value it expects.

Observed Behavior

Observed Behavior
The filter form submits object_type=<...> rather than object_type_id=<...>, so the filterset ignores the value and the list doesn’t change (or returns incorrect/empty results).

Additional Context
While working on a related feature request, I noticed two FilterForms that define the wrong field name for ContentType filtering:

  • CustomLinkFilterForm
  • SavedFilterFilterForm

These should use object_type_id (or set field_name='object_type_id') instead of object_type to match the filterset convention elsewhere in NetBox.

Originally created by @pheus on GitHub (Nov 19, 2025). Originally assigned to: @pheus on GitHub. ### NetBox Edition NetBox Community ### NetBox Version v4.4.6 ### Python Version 3.12 ### Steps to Reproduce 1) Go to **Extras → Custom Links** (`/extras/custom-links/`). 2) In the filter form, pick an object/model type and click **Apply**. 3) Note that the results aren’t constrained as expected. 4) Inspect the URL/query string: the form submits `object_type=<...>`. 5) Repeat the same flow under **Extras → Saved Filters** (`/extras/saved-filters/`) with the object/model type filter and observe the same behavior. ### Expected Behavior Selecting an object/model type in the filter form should narrow the list to items tied to that ContentType. The filter should submit `object_type_id=<content_type_id>` so the underlying filterset receives the value it expects. ### Observed Behavior **Observed Behavior** The filter form submits `object_type=<...>` rather than `object_type_id=<...>`, so the filterset ignores the value and the list doesn’t change (or returns incorrect/empty results). **Additional Context** While working on a related feature request, I noticed two FilterForms that define the wrong field name for ContentType filtering: - `CustomLinkFilterForm` - `SavedFilterFilterForm` These should use `object_type_id` (or set `field_name='object_type_id'`) instead of `object_type` to match the filterset convention elsewhere in NetBox.
adam added the type: bugstatus: acceptednetboxseverity: low labels 2025-12-29 21:50:43 +01:00
adam closed this issue 2025-12-29 21:50:43 +01:00
Author
Owner

@pheus commented on GitHub (Nov 19, 2025):

I’m happy to open a PR if this bug gets accepted.

@pheus commented on GitHub (Nov 19, 2025): I’m happy to open a PR if this bug gets accepted.
Author
Owner

@jeremystretch commented on GitHub (Nov 20, 2025):

Thanks @pheus!

@jeremystretch commented on GitHub (Nov 20, 2025): Thanks @pheus!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11853