Problem/Motivation
The ajax improvements in the 3.x branch of Facets are super awesome and super appreciated. It feels like we can take it to the next level (performance-wise) by adding GET support. When the views plugin support was initially added in #3073444: Create views plugins to render facets and summaries in filters and areas this was done through the views_ajax_get module. It looks like when ajax support was improved with BEF in #3306634: Integrate with better_exposed_filters for AJAX, the views_ajax_get integration was dropped.
Proposed resolution
My hope is to add that integration back here. Eventually when #956186: Allow AJAX to use GET requests lands we can drop the integration once again.
Remaining tasks
Create a patch that adds views_ajax_get integration.
User interface changes
None
API changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 93689d9ca1faadfbc7ef52f951dc4528847c300d.patch | 9.29 KB | pjotr van der horst |
Issue fork facets-3343860
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
malik.kotob commentedSlight tweaks to issue summary.
Comment #3
malik.kotob commentedUpdating issue summary to reference issue and Gitlab MR that removed GET support.
Comment #5
malik.kotob commentedMerge request is up!
Requires contrib modules to test:
Testing steps:
Comment #6
malik.kotob commentedComment #7
mkalkbrennerI think we should create a sub-module facets_ajax that has dependencies to better_exposed_filters and views_ajax_get.
In facets itself we should throw an exception if a view uses ajax and a facet gets rendered without facets_ajax beeing active.
Comment #8
catch#956186: Allow AJAX to use GET requests landed in 10.1.x, is some of this needed to work with the core change now?
Comment #9
smustgrave commentedChanging this to a bug now.
When using facets 3.0.x all ajax paginations are now broken.
Steps to reproduce
Install facets
Edit admin/content view by enabling ajax
Add enough content or edit view to trigger pagination.
Pagination no longer works.
Can also be seen in the media library widget.
Applying the MR resolved the problem.
Comment #10
catchUpdating the issue title. The RouteAlterSubscriber probably won't be necessary to add support for views_ajax_get any more (since that module should hopefully be deprecated from 10.1.x onwards), but most/all the rest of the changes look generic to support AJAX GET requests at all.
Comment #11
marios anagnostopoulos commented@mkalkbrenner I guess the approach should change now since the views_ajax_get is redundant?
Then again how would we handle BC for < 10.1.x sites?
Comment #12
mkalkbrennerhttps://www.drupal.org/node/3193798
Comment #13
pjotr van der horst commentedI've added 93689d9ca1faadfbc7ef52f951dc4528847c300d.patch to this issue.This patch contains the current state of the merge request. See "Patches from drupal.org merge request URLs are dangerous?" for more information.
Comment #14
pjotr van der horst commentedI've used a filename that was not websafe. My bad. I can't delete my previous comment. here is the patch with the commit hash as filename.
This patch contains the current state of the merge request. See "Patches from drupal.org merge request URLs are dangerous?" for more information.
Comment #15
strykaizerIn Facets 3 we removed all ajax support for facets as blocks, see #3379445: Facets breaks all AJAX views that uses pagers even without facets
You can use Facets Exposed Filters if you need AJAX support, which uses GET requests.