Skip to content

Fixes #851 - Missing pagination on locale index view#903

Open
Marvinrose wants to merge 4 commits intowagtail:mainfrom
Marvinrose:fix/locale-index-pagination
Open

Fixes #851 - Missing pagination on locale index view#903
Marvinrose wants to merge 4 commits intowagtail:mainfrom
Marvinrose:fix/locale-index-pagination

Conversation

@Marvinrose
Copy link
Copy Markdown
Contributor

What

Fixes #851 - The Settings, Locales page was capped at 20 locales with no way to access the rest.

Why

IndexView used a custom template (wagtaillocales/index.html) that overrode Wagtail's generic {% block listing %} with its own table loop. This bypassed Wagtail's built-in pagination entirely, meaning sites with 21+ locales could not access or manage the hidden ones.

Fix

  • Removed template_name from IndexView so it uses Wagtail's generic index template, which includes pagination automatically
  • Updated the custom template to extend the generic template while preserving the Usage column (page counts per locale)
  • Updated test_simple to assert the generic template is used instead of the custom one

Testing

All TestLocaleIndexView tests pass:

TestLocaleIndexView

@Marvinrose
Copy link
Copy Markdown
Contributor Author

I also noticed the 10 CI failures are caused by a pre-existing bug where Wagtail renamed produced_error_message to get_error_message in a newer version. The fix is to add produced_error_message = None to both CreateView and EditView so they're compatible with the latest Wagtail. I've opened issue #904 and submitted a fix in PR #905.

@zerolab
Copy link
Copy Markdown
Collaborator

zerolab commented Feb 27, 2026

#905 is now merged. Can you rebase, and also add a test please?

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.03%. Comparing base (8ba01e7) to head (774871b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #903   +/-   ##
=======================================
  Coverage   93.02%   93.03%           
=======================================
  Files          47       47           
  Lines        4245     4251    +6     
  Branches      551      552    +1     
=======================================
+ Hits         3949     3955    +6     
  Misses        177      177           
  Partials      119      119           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Marvinrose
Copy link
Copy Markdown
Contributor Author

Hi @zerolab

Rebased and added pagination test as requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

It shows only 20 locales without any pager in Settings/Locales

3 participants