Note: This could be an issue in Views itself; I found #2742565: Pagination breaks filtering by exposed filter and #2718697: EntityAutocomplete element cannot handle GET input values, but am still seeing the issue using core 8.1.2.
I have created a calendar view of items, along with an exposed filter of taxonomy terms associated with those items. On the default week, month, etc. displays (with no route argument), I can successfully use the exposed filter options (which add a query string to the base path).
However, the Previous/Next pagers are not passed the query string for the filtered items, so when I use the pagers I lose the filters on the display (though the option itself in my exposed remains selected).
Comment | File | Size | Author |
---|---|---|---|
#4 | pager-doesnt-inherit-exposed-filters-2744299-4.patch | 1.6 KB | sukanya.ramakrishnan |
Comments
Comment #2
akalata CreditAttribution: akalata commentedAs a temporary workaround, I've created the following preprocess function in a custom module, in case anyone else is interested:
Unfortunately, this fix only works when AJAX paging is NOT enabled.
Comment #3
akalata CreditAttribution: akalata commentedI also want to share a related workaround (that is almost certainly a Views issue), where submitting the exposed filters form while on a paged-to page (ie. /month/201607) reverts back to the basic /month path, without the routing argument.
Comment #4
sukanya.ramakrishnan CreditAttribution: sukanya.ramakrishnan commentedPlease review this patch when you get a chance, the pager urls were missing the filters!
Comment #5
sukanya.ramakrishnan CreditAttribution: sukanya.ramakrishnan commentedComment #6
jhedstromI've confirmed the issue manually, and confirmed the patch in #4 retains any exposed filter values on the pager links.
Comment #8
geertvd CreditAttribution: geertvd at XIO commentedSorry for the delay on this one, committed to 8.1-1.x. Thanks!
Comment #10
jeremylichtman CreditAttribution: jeremylichtman as a volunteer and for Cheeky Monkey Media commentedNote that #4 above still does not address the issue of "select multiple" filters (i.e. url param = ...&foo[]=bar&foo[]=buzz).
Although that may be an issue with views, rather than the calendar module, per se, since the values for the array param are already munged by the time they are passed through to the pager class.
I've created a version of the code in #2 that deals with the case above, here: https://www.drupal.org/node/2901061#comment-12215373
Comment #11
nwoodland CreditAttribution: nwoodland commentedI'm still encountering this issue even though the patch from #4 appears to be included in my version of dev. As a workaround I took the code from #2 and updated it to work with more than one exposed filter. Here's the code in case this helps anyone else: