Related Objects not clickable in Custom Fields #11730

Open
opened 2025-12-29 21:49:12 +01:00 by adam · 1 comment
Owner

Originally created by @kenneth-sfv on GitHub (Oct 15, 2025).

NetBox Edition

NetBox Community

NetBox Version

v4.4.2

Python Version

3.12

Steps to Reproduce

  1. Click Custom Fields tab
  2. Click one exsited custom field item that has at least one Related Objects
  3. Click item under Related Objects

Expected Behavior

When click the Related Objects , it should redirect to the object but it does nothing.

Observed Behavior

I see the items are there but when I click it nothing happens.

Image
Originally created by @kenneth-sfv on GitHub (Oct 15, 2025). ### NetBox Edition NetBox Community ### NetBox Version v4.4.2 ### Python Version 3.12 ### Steps to Reproduce 1. Click `Custom Fields` tab 2. Click one exsited custom field item that has at least one `Related Objects` 3. Click item under `Related Objects` ### Expected Behavior When click the `Related Objects` , it should redirect to the object but it does nothing. ### Observed Behavior I see the items are there but when I click it nothing happens. <img width="1481" height="432" alt="Image" src="https://github.com/user-attachments/assets/e4ea50dd-56e2-49e4-966b-8dc16d85ed30" />
adam added the type: bugstatus: needs ownernetboxseverity: low labels 2025-12-29 21:49:12 +01:00
Author
Owner

@bctiemann commented on GitHub (Oct 15, 2025):

I believe this is expected behavior or a known deficiency that is fundamental to the nature of custom fields. The template fragment for "Related Objects" is iterating through all the querysets in related_models in CustomFieldView:

2580485faf/netbox/extras/views.py (L62-L68)

Because these querysets are generated dynamically, it is not possible (or at least not easy) to determine what the backlink URL should be for each of the links in the "Related Objects" table.

However, it might be possible to modify this behavior in customfield.html to match the related_models found in other detail views, e.g. using this pattern:

2580485faf/netbox/templates/inc/panels/related_objects.html (L7-L10)

And substituting each qs queryset for the related_object_count.queryset in the above to get the same type of link_url and get the same behavior for Custom Field detail pages as for other objects. Note it may not be possible to do this properly if the filter_param is not achievable for custom fields.

Going to open this for volunteers to put some work into it.

(This also might be more appropriate as a feature request, assuming this current behavior is intended/expected behavior.)

@bctiemann commented on GitHub (Oct 15, 2025): I believe this is expected behavior or a known deficiency that is fundamental to the nature of custom fields. The template fragment for "Related Objects" is iterating through all the querysets in `related_models` in `CustomFieldView`: https://github.com/netbox-community/netbox/blob/2580485faf82aa2d6e61f481970b71f7874f00b9/netbox/extras/views.py#L62-L68 Because these querysets are generated dynamically, it is not possible (or at least not easy) to determine what the backlink URL should be for each of the links in the "Related Objects" table. However, it might be possible to modify this behavior in `customfield.html` to match the `related_models` found in other detail views, e.g. using this pattern: https://github.com/netbox-community/netbox/blob/2580485faf82aa2d6e61f481970b71f7874f00b9/netbox/templates/inc/panels/related_objects.html#L7-L10 And substituting each `qs` queryset for the `related_object_count.queryset` in the above to get the same type of `link_url` and get the same behavior for Custom Field detail pages as for other objects. Note it may not be possible to do this properly if the `filter_param` is not achievable for custom fields. Going to open this for volunteers to put some work into it. (This also might be more appropriate as a feature request, assuming this current behavior is intended/expected behavior.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11730