wagtail / wagtail

A Django content management system focused on flexibility and user experience

Home Page:https://wagtail.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WAGTAILIMAGES_CHOOSER_PAGE_SIZE setting has no effect

enzedonline opened this issue · comments

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

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.