Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When a facet block is used to filter a view block, and such a facet block is rendered before said views block, pagination on the views block breaks: i.e. views block only shows the first page.
The problem is caused by the "page" parameter being removed in QueryString::buildUrls().
Proposed resolution
Restoring the current page parameter at the end of the QueryString::buildUrls() execution solves the problem.
Comment | File | Size | Author |
---|---|---|---|
#2 | facets-querystring_url-2726455-2.patch | 774 bytes | ademarco |
Comments
Comment #2
ademarco CreditAttribution: ademarco at Nuvole commentedComment #3
borisson_This sounds reasonable.
Comment #4
StryKaizerDid some manual testing I can not reproduce the issue. prolly my fault though.
Can you please document how to reproduce this issue?
I created a search api views block, and a facet.
Pagination seems to work fine, but not sure how to ensure facets are rendered first though...
Comment #5
ademarco CreditAttribution: ademarco at Nuvole commentedThe issue happens with the current setup:
Modules enabled:
- page_manager
- page_manager_ui (page_manager's submodule)
- layout_plugin
- block_page_layout (layout_plugin's sub-module)
- facets, search_api etc.
Facets are places on a page manager page using a custom layout_plugin's layout on the, let's say, left sidebar, while on the right sidebar the actual search api results view block is placed.
With this setup facets are rendered before the block causing the issue.
Comment #6
ademarco CreditAttribution: ademarco at Nuvole commentedComment #7
StryKaizerThanks for the detailed documentation.
I managed to reproduce the issue and patch fixes it.
Patch looks good, RTBC-ing
Comment #9
StryKaizerComment #11
ChuChuNaKu CreditAttribution: ChuChuNaKu as a volunteer and at Acquia commentedJust an FYI. This patch seems to conflict with the patch in https://www.drupal.org/project/facets/issues/2726455 that removes the page parameter. As a result, the issue described in that ticket has re-appeared.
Both patches were merged and appear to compete with each other. One patch adds the page parameter and the other removes it. https://cgit.drupalcode.org/facets/tree/src/Plugin/facets/url_processor/...
Comment #12
StryKaizer@chuchunaku: could you link the correct issue? You mentioned the same issue as this issue in your comment ;)
Comment #13
ChuChuNaKu CreditAttribution: ChuChuNaKu as a volunteer and at Acquia commented@StryKaizer sorry about that! I meant to link to https://www.drupal.org/project/facets/issues/2898189