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
Having multiple view blocks on the same page with the GET option enabled and the pager configured to used Views Infinite scroller causes strange behaviour: the initial click on the load more is a POST request and the subsequent clicks are GET.
Remaining tasks
Investigate cause of problem and propose a solution.
Comment | File | Size | Author |
---|---|---|---|
#2 | multiple-views-support-3088768-2.patch | 1.06 KB | vasi1186 |
|
Comments
Comment #2
vasi1186 CreditAttribution: vasi1186 at Amazee Labs commentedI think this is most probably related to https://drupal.stackexchange.com/questions/246368/bug-or-a-feature-drupa...
In views_ajax_get_views_pre_render() the viewsAjaxGet setting is an indexed array, but this does not seem to work, only the first item is considered.
A fix would be to use associative arrays (which are converted to objects in JS) instead of indexed arrays. I attached a small patch that should fix the issue.
Comment #3
nbaosullivan CreditAttribution: nbaosullivan commentedTested patch in #2 on
8.7.5
with8.x-1.0-rc1
and this resolves the issue.Comment #5
Leon Kessler CreditAttribution: Leon Kessler commentedThanks vasi1186 and nbaosullivan. Patch looks good to me. Committed and pushed to 8.x-1.x branch.