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.
I am using an ajax view as view pane with exported settings for the pager. I set a different items per page setting in the view compared with the default one from the view and initially when the view pane is rendered on page it takes the view pane settings but when I start to paginate it takes the view pager settings.
I found a discussion about similar issue Ajax + Allow settings: Allowed settings lost on ajax (exposed forms/pager) for the ctools module but I think that is more view related.
Comments
Comment #1
boyan.borisov CreditAttribution: boyan.borisov commentedI found a solution that handles the items_per_page setting.
My idea is to add the items_per_page setting in the view ajax POST parameters and to use this parameter in the ajax view callback to set the correct setting.
Comment #2
AnybodyThe problem still exists and I think a solution is really required. Can someone perhaps have a look, how to solve this properly?
If there is already a good solution, an example implementation would help a lot, because this problem doesn't seem to be that seldom.
Comment #3
AnybodyI've used this patches base idea for a related problem and it works great.
#2052985: AJAX reload does NOT respect pager settings (items_per_page, etc.)
If this patch is finally applied to views, the related issue should be updated and becomes much smarter or is even no more required.
Comment #4
mansspams CreditAttribution: mansspams commented#1 works well here.Also related #1910608: Ajax + Allow settings: Allowed settings lost on ajax (exposed forms/pager)
Comment #5
jelo CreditAttribution: jelo commentedSame issue on my sites. Would be great to get a solution committed... I will try the patch soon.
Comment #6
Loparev CreditAttribution: Loparev commentedhi. I have improved your patch
Comment #7
rkostov CreditAttribution: rkostov at FFW commentedThe patches do not apply to 7.x-3.18 version. This was re-created from the first one and it's applicable to 7.x-3.18 version.
Comment #8
jedsaet CreditAttribution: jedsaet as a volunteer commentedPatch in #7 worked for me, I just had to re-roll against dev. Fixed a couple of coding standards issues while I was at it. :)