Pagination settings in View are not used

Created on 25 January 2023, over 2 years ago

Problem/Motivation

I have created both a View of Fields displayed as a table and a View of Base field override displayed as a table. In both tables I set the pagination to 100 items per page. No matter what pager I chose, I always get a table that show all the items on one page an no pager links show.

Steps to reproduce

  1. Create a View page display of any config entities that are supported by this module.
  2. Set the display format to "Table"
  3. Add some fields to populate the table.
  4. Set Pager to use Mini and set to 10 items per page
  5. View the display, notice that all the items show, not just 10. Notice there is no pager links shown at the bottom.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States swirt Florida

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

Merge Requests

Comments & Activities

  • Issue created by @swirt
  • πŸ‡ΊπŸ‡ΈUnited States swirt Florida

    Interesting side note. If you display the results summary in the header, it shows "Displaying 1 - 10 of 817" So the counter knows correctly how many it should be showing.

  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    Thanks for the steps to reproduce.

    As we are programatically creating the views, we likely are avoiding the additional complexity of adding the pagers.

    I suspect that this may be an opportunity to look at the code that builds up the views. Adding a pager should be an additional call. I haven't spent a lot of time looking at view "Builder" code. I hope the pieces that would make this easy are there.

  • First commit to issue fork.
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Added pagination support + test coverage.

    My concern is that all of a sudden pagination is kicking in and existing sites are seeing all results. Probably we need to add an update hook to the views provided by this module and check if the pagination is unchanged, and if so, set to unlimited to maintain the status quo. When someone does a composer update to this module, they are unlikely to otherwise notice immediately.

    Alternatively we could make it clear in the release notes, but not confident how well that will get noticed...

  • Merge request !16Add pagination support with tests β†’ (Merged) created by scott_euser
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Okay tests passing now

  • πŸ‡¬πŸ‡§United Kingdom scott_euser
  • Pipeline finished with Skipped
    5 months ago
    #418446
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Okay going to go for release notes idea since its a bug not a feature (even if there is some small risk people may be using it as such, they'll see the pagination since this does not work with areas that don't support pagination like ✨ Make this module work with Views Selection from Core Active yet).

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024