Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WAGTAILIMAGES_CHOOSER_PAGE_SIZE setting has no effect #11813

Closed
enzedonline opened this issue Apr 2, 2024 · 1 comment · Fixed by #11937
Closed

WAGTAILIMAGES_CHOOSER_PAGE_SIZE setting has no effect #11813

enzedonline opened this issue Apr 2, 2024 · 1 comment · Fixed by #11937
Labels
component:Choosers Modal choosers for Page, Snippet and other models component:Images type:Bug

Comments

@enzedonline
Copy link

enzedonline commented Apr 2, 2024

Using the WAGTAILIMAGES_CHOOSER_PAGE_SIZE setting has no effect on image chooser pagination size.

I've set a breakpoint in BaseImageChooseView.__init__() and confirmed that per_page gets the correct custom setting. Setting a breakpoint in BaseImageChooseView.get_context_data() and wagtailimages/chooser/chooser,html, per_page is 10.

Steps to Reproduce

Add setting to base.py with any valid integer value.
Model image count per page remains fixed at 10.

  • I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: yes

Technical details

  • Python version: 3.12
  • Django version: 4.2, 5.0
  • Wagtail version: 5.23, 6.01
  • Browser version: Chrome 123
@enzedonline enzedonline added status:Unconfirmed Issue, usually a bug, that has not yet been validated as a confirmed problem. type:Bug labels Apr 2, 2024
@rohitsrma
Copy link
Contributor

I can confirm the issue exists.

The problem isn't limited to the image chooser; it's also affecting the snippets and documents choosers. This issue arises due to a naming conflict between the per_page attribute in BaseChooseView and ChooserViewSet. Regardless of the value set in the per_page attribute of the chooseview, only 10 items are displayed per page.

@gasman gasman closed this as completed in bfdd13f Apr 26, 2024
@lb- lb- added component:Images component:Choosers Modal choosers for Page, Snippet and other models and removed status:Unconfirmed Issue, usually a bug, that has not yet been validated as a confirmed problem. labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment