netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Elements per page setting is discarded after editing an object

Open vic-t opened this issue 5 months ago • 3 comments

Deployment Type

Self-hosted

NetBox Version

v4.3.3

Python Version

3.12

Steps to Reproduce

  1. Go into the "Interfaces" overview. This assumes that you have more than 25 interfaces.
  2. In the lower right corner, press the drop down "Per Page" and select that you wish to see 100 entries.
  3. Select two elements in this longer list, press "Edit Selected"
  4. Do the necessary changes and save.
  5. You're now being taken back to the "Interfaces" overview. You're back in the default view of 25 entries instead of 100.

Expected Behavior

I would expect that the setting remains active until I decide to leave the overview by explicitly navigating somewhere else.

Observed Behavior

As mentioned in "Steps to reproduce"

vic-t avatar Jul 13 '25 21:07 vic-t

I was very tempted to argue that this is intended behavior (in that it doesn't seem to have ever been considered) and that a feature request should be filed, if this should be added. However, while triaging this, I noticed that we're handling this differently for per_page values above the default as we are below the default--which is odd.

I will dig in to the more in a bit.

jnovinger avatar Jul 14 '25 17:07 jnovinger

To elaborate a bit on my comment from July, there's definitely some inconsistent behavior. For instance:

  • If you select any of the predefined pagination sizes other than 100 (in my case, might be because of NetBox defaults or user preferences), then after a bulk edit, the pagination is reset back to 100.
  • If you manually set the per_page GET param to (it appears) anything else, like ?per_page=101, ?per_page=99, or even ?per_page=1, then the custom pagination is maintained after the bulk edit is completed.
  • Newly discovered just now, if you select one of the predefined pagination options, like say 500, after having set one manually like above, then you are redirected to the listing page and the previous manually set pagination number is used. In my case, I manually set ?per_page=101, did an edit, then selected 500 on the list page I was redirected to, then did another edit, and was redirected to the list page again which showed Showing 1-101 of 1613 and had ?per_page=101 in the URL.

So tl;dr, there's definitely a bug here. Opening it up for anyone that is interested. Apologies to all for letting it sit so long.

jnovinger avatar Sep 12 '25 14:09 jnovinger

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

github-actions[bot] avatar Dec 12 '25 04:12 github-actions[bot]