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"

CommentFileSizeAuthor
#2 items-2.png6.23 KBmiiimooo
#2 items-0.png34.52 KBmiiimooo
#2 items-1.png15.14 KBmiiimooo

Comments

miiimooo created an issue. See original summary.

miiimooo’s picture

StatusFileSize
new15.14 KB
new34.52 KB
new6.23 KB

Version: 8.1.7 » 8.1.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Version: 8.1.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Version: 8.9.x-dev » 9.2.x-dev
Issue summary: View changes
Issue tags: +Bug Smash Initiative

I'm not convinced this is a bug, as it doesn't seem safe to assume that 'Items per page' will work perfectly if you aren't using a pager. But, since it is possible to configure this, it may be fair enough that it should work?

I have updated the IS for clarity as it took me a while to understand the issue.

pameeela’s picture

Title: Select option for the All items label when pager limit set to 0 » Show 'All items' by default for 'Items per page' when pager limit set to 0
pameeela’s picture

Issue summary: View changes
pameeela’s picture

Version: 9.2.x-dev » 8.9.x-dev

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

johnv’s picture

Title: Show 'All items' by default for 'Items per page' when pager limit set to 0 » Show 'All items' by default for exposed 'Items per page' when pager limit set to 0
johnv’s picture

Component: views.module » views_ui.module
Category: Bug report » Feature request
johnv’s picture

Title: Show 'All items' by default for exposed 'Items per page' when pager limit set to 0 » Pager option 'Items per page' with exposed value 0 should by default show 'All items' on view

Sorting multiple issues with "Pager option 'Items per page' with value 0" alphabetically.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.