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.

Comments

hctom created an issue. See original summary.

ralliaf’s picture

Hello,
i check the current page of the view in VLMEventSubscriber.php to solve the issue.
I'm attaching a patch.

sam152’s picture

If the posted solution doesn't work, the views_infinite_scroll has support for exposed filters.

d.novikov’s picture

Thank you, the patch worked fine for me. Attaching a cleaned up version.

zalak.addweb’s picture

Issue tags: +views load more
kpv’s picture

Status: Active » Needs review
crtlf’s picture

Thank you for the patch, it works well for me

danielnolde’s picture

Patch views_load_more-problems-with-exposed-filters-2630306-4.patch works well for me as well.

Thanks, guys!!

megadesk3000’s picture

The patch #4 works

ivanhelguera’s picture

Status: Needs review » Reviewed & tested by the community

  • baikho committed a393e35 on 2.x authored by d.novikov
    Issue #2630306 by d.novikov, ralliaf, hctom, Sam152, zalak.addweb, kpv,...
baikho’s picture

Version: 8.x-1.x-dev » 2.x-dev
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.