Pagers don't work

Created on 15 June 2022, about 2 years ago
Updated 23 May 2024, about 1 month ago

Problem/Motivation

Because the module is using ->setExposedInput changing a filter and then using a pager always goes back to the original filter value

Steps to reproduce

  1. Create a view with an exposed field and a pager
  2. Configure the exposed field to be editable in the block config
  3. Create an instance of the block and set a default value
  4. View the page with the block
  5. Change the filter to use a different value
  6. Use the pager
  7. Note that the value is reset from the previous change at 5
  8. You're stranded on a page that doesn't exist

Proposed resolution

Don't use ->setExposed filters to set the values, set the default value in the filter instead

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

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.

  • πŸ‡ΊπŸ‡ΈUnited States chrisgross

    Is this supposed to work when a views display is AJAX enabled? It does not seem to for me.

  • πŸ‡ΊπŸ‡ΈUnited States chrisgross

    I'm not sure if this belongs here or in another issue, but even with this patch, I am running into issue with pagers when using this module.

    I am seeing a problem where re-used displays appear to be using some sort of hidden shared variable for their pagers (I don't know if it is using the pager ID behind the scenes or what). If I place the same views block on a layout builder page twice, but simply change the "Items per block" on one block, which leaving the other on the default value, the pagers completely break.

    For example, if I set the first block to show one result per page and the second one to use the default (5), all results are displayed in both blocks and they both lose their pagers. If I instead set the first block to use the default (5) and the second block to display one, then both blocks get pagers that indicate there is only one result, but the first block is displaying all of its results. So if I click on one one of the pager numbers for that block, the results disappear, as if I have navigated to a page that doesn't exist, and then that pager disappears.

    It sounds like this is similar to the issue being described here, only it is something that happens when multiple identical blocks are placed on a page.

  • Status changed to Needs work about 1 month ago
  • πŸ‡ΊπŸ‡ΈUnited States wylbur Minneapolis, Minnesota, USA

    Based on the comments, marking as needs work.

Production build 0.69.0 2024