Show 'All items' by default for exposed 'Items per page' when pager limit set to 0

Created on 29 August 2016, over 8 years ago
Updated 26 January 2025, 1 day ago

Problem/Motivation

If you create a view with the pager options set to no limit by setting the items per page to 0, but then allow users to control the number per page, the page loads with the the 'Items per page' drop down defaulting to the first of these options even though all items are displayed.

Steps to reproduce

  1. Install Drupal
  2. Create 10 articles
  3. Create a view page of articles with the following pager settings:
    1. 0 items per page (no limit)
    2. Check 'Allow user to control the number of items displayed in this view' and 'Allow user to display all items'
  4. View the page, see that the 'Items per page' drop down displays '5' even though all items are displayed

Proposed resolution

If the pager is configured with no limit, set the dropdown default to - All -

Remaining tasks

  1. Confirm this should be addressed
  2. Write patch with tests
  3. Review

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Original report by miiimooo

I have a pager set to 0 to display all items by default. When the view with the exposed filters is displayed the initial value is the first from the "Exposed items per page options". Although all items are displayed at this point the next time a filter is applied it will be limited to 5 results.

When the limit is set to 0 and the EXPOSED OPTIONS has "Allow user to display all items" set then it should select the label set in the "All items label"

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

views.module

Created by

miiimooo Europe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024