Custom field 'field type' and 'content types' filters do not work as expected #6627

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

Originally created by @pgnuta on GitHub (Jul 4, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.2.5

Python version

3.9

Steps to Reproduce

Define a selection of custom fields and then use the "field type" or "content type" filter to filter out the non-matching custom fields.

No filters applied shows all results:
image

Expected Behavior

In the case of the "field type" filter expected behaviour would be that only "Text" results would be shown
In the case of the "content type" filter expected behaviour would be that only custom fields that are applied to "tenancy | tenant" objects would be shown.

Observed Behavior

"Text" field type filter applied does not filter any of the non-text type results out.
image

"tenancy | tenant" content type filter applied removes all results.
image

Originally created by @pgnuta on GitHub (Jul 4, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.2.5 ### Python version 3.9 ### Steps to Reproduce Define a selection of custom fields and then use the "field type" or "content type" filter to filter out the non-matching custom fields. No filters applied shows all results: ![image](https://user-images.githubusercontent.com/19255358/177139551-606b13c4-e320-4203-83d2-c490415cb6d7.png) ### Expected Behavior In the case of the "field type" filter expected behaviour would be that only "Text" results would be shown In the case of the "content type" filter expected behaviour would be that only custom fields that are applied to "tenancy | tenant" objects would be shown. ### Observed Behavior "Text" field type filter applied does not filter any of the non-text type results out. ![image](https://user-images.githubusercontent.com/19255358/177139645-81937411-023e-4c60-bef2-94c05fea40eb.png) "tenancy | tenant" content type filter applied removes all results. ![image](https://user-images.githubusercontent.com/19255358/177139741-b7bd1ac1-2eac-4e46-baef-b731adaea463.png)
adam added the type: bugstatus: accepted labels 2025-12-29 19:43:17 +01:00
adam closed this issue 2025-12-29 19:43:17 +01:00
Author
Owner

@julianstolp commented on GitHub (Jul 5, 2022):

I can reproduce it with 3.2.5 an Python 3.8.
Maybe its because the API-Endpoint is different from the input in the URL, which gets filled by the filterfunction.

There is no field type and the content_types field is expecting a string but gets an id.
If I use the filter ?content_types=dcim.interface it gets filtered correctly.

image

image

@julianstolp commented on GitHub (Jul 5, 2022): I can reproduce it with 3.2.5 an Python 3.8. Maybe its because the API-Endpoint is different from the input in the URL, which gets filled by the filterfunction. There is no field *type* and the *content_types* field is expecting a string but gets an id. If I use the filter ?content_types=dcim.interface it gets filtered correctly. ![image](https://user-images.githubusercontent.com/41152397/177312567-aa329ed4-6465-4fda-9a66-51bd79ad4b57.png) ![image](https://user-images.githubusercontent.com/41152397/177312272-cfdd25be-7934-4066-bb15-1918e2d7d45a.png)
Author
Owner

@jeremystretch commented on GitHub (Jul 8, 2022):

The webhooks list in the UI is affected by the same bug. The issue is that the filter form is using the wrong filter name.

@jeremystretch commented on GitHub (Jul 8, 2022): The webhooks list in the UI is affected by the same bug. The issue is that the filter form is using the wrong filter name.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6627