I just ran into an issue having a Views Load More pager and exposed filters. The load more functionality works fine with the patch from #2543714-2: Template change to keep up with core, but the exposed filter's won't work anymore as expected.
Steps to reproduce
- Create a fresh Drupal instance with Standard profile
- Install views_load_more Module with the patch from #2543714-2: Template change to keep up with core
- Create a basic view page listing all content, enable Ajax, for it, use views load more pager with 1 item per page and add an exposed filter for the content type
- Create some content of type article and page
- Open the before created view page and check load more functionality -> should work fine
- Refresh the view page to start without appended items and fiddle around with the exposed filter -> new content items will be appended, but existing ones won't be removed (which should happen because of the selected filter criteria)
So this looks like the view load more functionality is not only triggered for pager events of views, but also for ajax-driven exposed filter changes, which may be obwious, because in VLMEventSubscriber the response is only checked with instanceof ViewAjaxResponse which may be any views ajax response, but not only pagination responses.
Does anybody have an idea how to solve that problem? Feel free to ask, if you need any other information regarding this problem.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | views_load_more-problems-with-exposed-filters-2630306-4.patch | 643 bytes | d.novikov |
| #2 | views_load_more-problems-with-exposed-filters-2630306-drupal8.patch | 627 bytes | ralliaf |
Comments
Comment #2
ralliaf commentedHello,
i check the current page of the view in VLMEventSubscriber.php to solve the issue.
I'm attaching a patch.
Comment #3
sam152 commentedIf the posted solution doesn't work, the views_infinite_scroll has support for exposed filters.
Comment #4
d.novikov commentedThank you, the patch worked fine for me. Attaching a cleaned up version.
Comment #5
zalak.addweb commentedComment #6
kpv commentedComment #7
crtlf commentedThank you for the patch, it works well for me
Comment #8
danielnolde commentedPatch views_load_more-problems-with-exposed-filters-2630306-4.patch works well for me as well.
Thanks, guys!!
Comment #9
megadesk3000 commentedThe patch #4 works
Comment #10
ivanhelguera commentedComment #12
baikho commented