- last update
about 1 year ago 63 pass - 🇯🇴Jordan n.ghunaim Amman - Jordan
Updated the patch to fix an Ajax error that appears on the view UI page.
ctools_views provides a cool feature to override views contextual filter value directly through block UI (@see patch https://www.drupal.org/files/issues/2020-01-14/ctools_views-pass_argumen... → ), so e.g. you can add a block view display with content type contextual filter, go to node layout builder & put this views block as layout component to a layout section, click component settings button & select contextual filter value directly in the layout builder.
So we can have 1 views display & endless blocks with different display options - we like this & use a lot on our project.
However the ajax implementation is completely broken, so the project idea was to have configurable search pages (panel page as node bundle with enabled custom layout per node). We use facets (ajax filters), views pages, exposed filter as a separate block & this contextual filters & the rest block UI made views overrides weren't considered on ajax calls & views returned bad results or blank html.
This is almost dirty hack please don't consider this as think through solution, however it perfectly suits our needs for the project, so idea was to share this to people who also interested in this functionality & to think through the better solution for abstract logic.
How it works & what it does: we have views pre build hook in ctools_views module which is invoked for both ajax views & ajax facets calls, then we find entity from views path & loading a layout for it, then we go through sections until we find views display block section (not separate exposed filters block) & fetch config from there, then we create a stub block instance with this config & use it to process our current views to apply all ctools_views related changes on top of existing views. This way our facets, pager & the rest ajax related views/facets based logic starts working as it should by design.
Get rid of garbage, implement tests, think though the task & probably propose a better design.
Needs review
3.2
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Updated the patch to fix an Ajax error that appears on the view UI page.