Regression: Bulk Edit fails to update Scope when using ContentTypeChoiceField (HTMX) #10987

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

Originally created by @pheus on GitHub (Apr 6, 2025).

Originally assigned to: @jnovinger on GitHub.

Deployment Type

Self-hosted

NetBox Version

main (v4.2.7)

Python Version

3.10

Steps to Reproduce

  1. Create a Site named Site1
  2. Create a Prefix 10.0.0.0/16 with:
    • Scope Type: Site
    • Scope: Site1
  3. Navigate to IPAM → Prefixes (PrefixListView)
  4. Select the prefix 10.0.0.0/16 using the checkbox ()
  5. Click Edit Selected to initiate a bulk edit
  6. In the bulk edit form:
    • Change the Scope Type dropdown to Location (or any other valid choice)
    • Attempt to select a Scope from the corresponding dropdown

Expected Behavior

  • After selecting a Scope Type, the Scope dropdown should become active and list the available objects of the selected type.

Observed Behavior

  • The Scope Type field gets reset to None
  • The Scope field remains disabled
  • This effectively prevents setting a Scope during bulk edits

When performing bulk edits on models utilizing a ContentTypeChoiceField (typically for GenericForeignKey fields), the dynamic behavior of the Scope field is broken. Specifically, selecting a Scope Type fails to properly enable and populate the corresponding Scope field.

This is a recent regression, which is included in the upcoming v4.2.7 patch release.

Regression Introduced By

Commit: 12231ad
Pull Request: #18997 Select all with bulk edit only changes the currently visible objects
Related Issue: #18964 The function of selecting all devices fails.

Originally created by @pheus on GitHub (Apr 6, 2025). Originally assigned to: @jnovinger on GitHub. ### Deployment Type Self-hosted ### NetBox Version main (v4.2.7) ### Python Version 3.10 ### Steps to Reproduce 1. Create a Site named `Site1` 2. Create a Prefix `10.0.0.0/16` with: - *Scope Type*: `Site` - *Scope*: `Site1` 3. Navigate to *IPAM → Prefixes* (PrefixListView) 4. Select the prefix `10.0.0.0/16` using the checkbox (✅) 5. Click *Edit Selected* to initiate a bulk edit 6. In the bulk edit form: - Change the *Scope Type* dropdown to `Location` (or any other valid choice) - Attempt to select a *Scope* from the corresponding dropdown ### Expected Behavior - After selecting a *Scope Type*, the *Scope* dropdown should become active and list the available objects of the selected type. ### Observed Behavior - The *Scope Type* field gets reset to `None` - The *Scope* field remains disabled - This effectively prevents setting a *Scope* during bulk edits --- When performing bulk edits on models utilizing a `ContentTypeChoiceField` (typically for `GenericForeignKey` fields), the dynamic behavior of the *Scope* field is broken. Specifically, selecting a *Scope Type* fails to properly enable and populate the corresponding *Scope* field. This is a recent regression, which is included in the upcoming **v4.2.7** patch release. **Regression Introduced By** Commit: [`12231ad`](https://github.com/netbox-community/netbox/commit/12231ad71a36f7cd4a727806284ef1228510ea8a) Pull Request: [#18997](https://github.com/netbox-community/netbox/pull/18997) Select all with bulk edit only changes the currently visible objects Related Issue: [#18964](https://github.com/netbox-community/netbox/issues/18964) The function of selecting all devices fails.
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:38:50 +01:00
adam closed this issue 2025-12-29 21:38:50 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10987