Closed ibuclaw closed 5 months ago
I suspect it was introduced by https://github.com/netbox-community/netbox/commit/a46255ddda73e1e29c610d40aeb7054214014935
So I can't say why I'm not seeing this in 3.7.x then - maybe plug-ins pick up the upstream Django template, and not the Netbox vendored version, and now this is no longer the case in 4.x.
Ah-ha! I don't see it in plug-ins as they are fudging the UI because of this bug.
https://github.com/netbox-community/netbox-topology-views/pull/408
Arbitrarily modifying core code does not constitute a valid bug report. Please modify your post above to describe the specific behavior in NetBox you believe is unintentional.
It presents - in a bite-size example - code that already exists in plugins that "NetBox Cloud and NetBox Enterprise include commercial support for..." are doing, and NetBox is breaking them by injecting bad html for this field type.
There already one hacky condition in the template because some other part of NetBox got broke by it.
{% if widget.name != '_selected_action' %}
If this was instead something along the lines of
{% if htmx_enabled %}
Then that would resolve the issue - if I correctly understand the original intention for introducing this hidden input field.
@ibuclaw the code you reference was added intentionally and serves a purpose. If you would like to propose an alternative solution, please submit a feature request citing the detailed proposal and justification for the change.
I'm closing this issue as it does not identify unexpected, reproducible behavior in NetBox itself.
Deployment Type
Self-hosted
NetBox Version
v4.0.3
Python Version
3.11
Steps to Reproduce
forms.BooleanField
parameter to a Filters form, e.g:/dcim/sites/
->Filters
Expected Behavior
NetBox 3.7 rendered this as something like:
Observed Behavior
There is a
hidden
input with the same name that did not exist in 3.7.x.As far as I can tell, this means
BooleanField
's are ignored due to this GET event listener deleting all form data for it, because the "hidden" input has an empty value. https://github.com/netbox-community/netbox/blob/103c08c2d2bc3e32d8274b8d8ec8dd2380857388/netbox/project-static/src/netbox.ts#L44-L47