'Select all 75 items matching query' selects too many prefixes #4918

Closed
opened 2025-12-29 19:22:15 +01:00 by adam · 11 comments
Owner

Originally created by @PieterL75 on GitHub (May 17, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.11.3

Python version

3.6

Steps to Reproduce

Test is done on https://demo.netbox.dev/

  1. create 2 new subnets under 100.64.0.0/10 (ex 100.64.0.0/16 and 100.65.0.0/16) https://demo.netbox.dev/ipam/aggregates/4/
  2. go to 10.0.0.0/8 aggregate (https://demo.netbox.dev/ipam/aggregates/1/)
  3. Set the page length to 25
  4. Check the checkbox before 'Prefix'
  5. Check the checkbox for 'Select all 75 items matching query'
  6. Click the 'Edit all' on the right, or the 'edit selected' at the bottom

Expected Behavior

Only the 10.0.0.0/8 prefixes are selected and ready to be bulk edited

Observed Behavior

Not only the 10.0.0.0/8 prefixes are selected, but also the 2 new created 100.64.0.0/10 prefixes.
In my production netbox, this action results in selecting all of my prefixes, and not the one from the table.

Originally created by @PieterL75 on GitHub (May 17, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.11.3 ### Python version 3.6 ### Steps to Reproduce Test is done on https://demo.netbox.dev/ 1. create 2 new subnets under 100.64.0.0/10 (ex 100.64.0.0/16 and 100.65.0.0/16) https://demo.netbox.dev/ipam/aggregates/4/ 2. go to 10.0.0.0/8 aggregate (https://demo.netbox.dev/ipam/aggregates/1/) 3. Set the page length to 25 3. Check the checkbox before 'Prefix' 4. Check the checkbox for 'Select all 75 items matching query' 5. Click the 'Edit all' on the right, or the 'edit selected' at the bottom ### Expected Behavior Only the 10.0.0.0/8 prefixes are selected and ready to be bulk edited ### Observed Behavior Not only the 10.0.0.0/8 prefixes are selected, but also the 2 new created 100.64.0.0/10 prefixes. In my production netbox, this action results in selecting all of my prefixes, and not the one from the table.
adam added the type: bugstatus: accepted labels 2025-12-29 19:22:15 +01:00
adam closed this issue 2025-12-29 19:22:15 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 17, 2021):

Please don't reference the demo instance for bug reports. The demo instance data is reset nightly and and is not suitable for reliable reproduction. Please modify your report above so that someone with a default, empty NetBox installation can reproduce the reported behavior.

@jeremystretch commented on GitHub (May 17, 2021): Please don't reference the demo instance for bug reports. The demo instance data is reset nightly and and is not suitable for reliable reproduction. Please modify your report above so that someone with a default, empty NetBox installation can reproduce the reported behavior.
Author
Owner

@PieterL75 commented on GitHub (May 17, 2021):

The same steps with an empty Netbox reproduces the issue.
Create 2 aggregates, create a 40 prefixes in one aggregate, 5 in the other.
Run a bulk edit on the 40 prefixes with a 25 pagination.
That will show all 45 prefixes selected, in stead of that 40 of the aggregate you were editing.

And I assumed, that the demo was a good reference, as the data is cleared daily, running the latest version, and thus reproducible.

Pieter

@PieterL75 commented on GitHub (May 17, 2021): The same steps with an empty Netbox reproduces the issue. Create 2 aggregates, create a 40 prefixes in one aggregate, 5 in the other. Run a bulk edit on the 40 prefixes with a 25 pagination. That will show all 45 prefixes selected, in stead of that 40 of the aggregate you were editing. And I assumed, that the demo was a good reference, as the data is cleared daily, running the latest version, and thus reproducible. Pieter
Author
Owner

@jeremystretch commented on GitHub (May 18, 2021):

And I assumed, that the demo was a good reference, as the data is cleared daily, running the latest version, and thus reproducible.

It's a public demo instance, which means that anyone can, at any time, create conflicting data or modify or delete the data relevant to your report. We require that all bug reports include concise, detailed reproduction steps to minimize the time it takes a maintainer or other volunteer to test the reported condition.

@jeremystretch commented on GitHub (May 18, 2021): > And I assumed, that the demo was a good reference, as the data is cleared daily, running the latest version, and thus reproducible. It's a public demo instance, which means that anyone can, at any time, create conflicting data or modify or delete the data relevant to your report. We require that all bug reports include concise, detailed reproduction steps to minimize the time it takes a maintainer or other volunteer to test the reported condition.
Author
Owner

@jeremystretch commented on GitHub (May 18, 2021):

Please revise your original post to provide a concise set of reproduction steps.

@jeremystretch commented on GitHub (May 18, 2021): Please revise your original post to provide a concise set of reproduction steps.
Author
Owner

@jeremystretch commented on GitHub (Jun 2, 2021):

The problem here is that the bulk edit operation is working off of the annotated table data, which (by default) includes available prefixes. We'll need to devise a way to work off the underlying queryset directly, which currently is not passed to the table.

As a workaround, you can click the "hide available" button at the top of the page. This will report the correct number of objects and allow you to edit all of them (and only those objects).

@jeremystretch commented on GitHub (Jun 2, 2021): The problem here is that the bulk edit operation is working off of the annotated table data, which (by default) includes available prefixes. We'll need to devise a way to work off the underlying queryset directly, which currently is not passed to the table. As a workaround, you can click the "hide available" button at the top of the page. This will report the correct number of objects and allow you to edit all of them (and only those objects).
Author
Owner

@bluikko commented on GitHub (Sep 2, 2021):

I think this is the same issue I am having: enter something to "Filter" on "Prefixes" page, choose select all button -> all prefixes are selected for bulk action and not just the filtered prefixes?
I do not see a "Hide available" button on 3.0.1?

Edit: apparently filtering using the "Filters" tab does work right - it is only the 'freeform' "Filter" field that doesn't apply to bulk selections?

@bluikko commented on GitHub (Sep 2, 2021): I think this is the same issue I am having: enter something to "Filter" on "Prefixes" page, choose select all button -> all prefixes are selected for bulk action and not just the filtered prefixes? I do not see a "Hide available" button on 3.0.1? Edit: apparently filtering using the "Filters" tab does work right - it is only the 'freeform' "Filter" field that doesn't apply to bulk selections?
Author
Owner

@maxzapp commented on GitHub (Sep 21, 2021):

Hi,

have the same problem on devices and circiuits (seems to be generic). If i use the small line for filtering for any specific item and check the checkbox to select all for editing something , i expecting only all of the selctet ones, but it will change on all of the items not only the selected ones. If i use the filter tab it is working correct.

br
maxzapp
v3.0.2

@maxzapp commented on GitHub (Sep 21, 2021): Hi, have the same problem on devices and circiuits (seems to be generic). If i use the small line for filtering for any specific item and check the checkbox to select all for editing something , i expecting only all of the selctet ones, but it will change on all of the items not only the selected ones. If i use the filter tab it is working correct. br maxzapp v3.0.2
Author
Owner

@ziggekatten commented on GitHub (Sep 22, 2021):

I just hit this one badly today on devices, when using the "filter" field, that ended up with 40 devices with incorrect data......

Steps to reproduce:

  • In DCIM -> Devices, add five devices of any kind with name: Bob-1 to Bob-5
  • In DCIM -> Devices, add five devices of any kind with name: Gupta-1 to Gupta-5
  • In the DCIM->Device list, select the Filter field ant type in "Gupta"
  • When the "Gupta" devices have been filtered out, klick the tickbox "Name" (toggle all) to select all
  • Click edit selected
  • Add an tag to the objects an press apply
  • In the DCIM->Devices, now remove the filter

Result: All devices have recieved the added tag, not only the "Gupta" ones.

If using the Filter tab, it work as it should.

Quick fix would be to remove the possibility to click the "Name" (Toggle All) box in when using the base tab, and only allow it on the filter tab.

@ziggekatten commented on GitHub (Sep 22, 2021): I just hit this one badly today on devices, when using the "filter" field, that ended up with 40 devices with incorrect data...... Steps to reproduce: - In DCIM -> Devices, add five devices of any kind with name: Bob-1 to Bob-5 - In DCIM -> Devices, add five devices of any kind with name: Gupta-1 to Gupta-5 - In the DCIM->Device list, select the Filter field ant type in "Gupta" - When the "Gupta" devices have been filtered out, klick the tickbox "Name" (toggle all) to select all - Click edit selected - Add an tag to the objects an press apply - In the DCIM->Devices, now remove the filter Result: All devices have recieved the added tag, not only the "Gupta" ones. If using the Filter tab, it work as it should. Quick fix would be to remove the possibility to click the "Name" (Toggle All) box in when using the base tab, and only allow it on the filter tab.
Author
Owner

@jeremystretch commented on GitHub (Oct 1, 2021):

@ziggekatten Different issue. This is specifically for prefixes under the aggregate view. Upon submission of the form, the queryset of child prefixes is not being properly filtered by the aggregate prefix.

@jeremystretch commented on GitHub (Oct 1, 2021): @ziggekatten Different issue. This is specifically for prefixes under the aggregate view. Upon submission of the form, the queryset of child prefixes is not being properly filtered by the aggregate prefix.
Author
Owner

@maxzapp commented on GitHub (Oct 3, 2021):

@jeremystretch hi i understand that our observatiion is a different problem but it is a problem, do we have to open it somewhere else? I am new to github and i fo not how.

@maxzapp commented on GitHub (Oct 3, 2021): @jeremystretch hi i understand that our observatiion is a different problem but it is a problem, do we have to open it somewhere else? I am new to github and i fo not how.
Author
Owner

@jeremystretch commented on GitHub (Oct 4, 2021):

@maxzapp yes, please open a new bug report providing all of the information requested in the template.

@jeremystretch commented on GitHub (Oct 4, 2021): @maxzapp yes, please open a new bug report providing all of the information requested in the template.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4918