- 🇺🇸United States devkinetic
Is this issue for 1.5 or 2.0.x ? How is this different from the solution provided in #2986981-30: Ajax facet block seems to lose Views context (filters, etc) → ?
- 🇮🇹Italy tanc Italy
Patch in #8 applies cleanly against 2.0.6 and fixes the issue I was seeing that is similar or the same as the issue in #5 with embedded facets and view with ajax enabled.
The page's path was being added to the url every time a facet was checked or unchecked. For example, on a node page containing embedded view and facets blocks with a url of
/kalender
, after checking and unchecking theevents_relevant_for
facet checkbox the url would end up looking like:/kalender?q=/kalender%3Fq%3D/kalender%3Fq%3D/kalender%3Fq%3D/kalender%3Fq%3D/kalender%3Fq%3D/kalender%3Fq%3D/kalender%3Fq%3D/kalender%3Fq%3D/kalender%3Fq%3D/kalender%3Ff%5B0%5D%3Devents_relevant_for%3A101&f%5B0%5D=events_relevant_for%3A100
With this patch the url looks like this after checking and unchecking the
events_relevant_for
facet checkbox a few times:/kalender?f%5B0%5D=events_relevant_for%3A114&keywords=
- 🇮🇳India kaustubhb Mumbai
I am testing this patch with the AJAX issue which is mentioned here:
Facets with AJAX not working in most of situations ( https://www.drupal.org/node/3052574 → )
But together both the patches do not seem to work,
- Status changed to Needs review
about 1 year ago 12:43am 7 October 2023 - last update
about 1 year ago 424 pass, 2 fail - 🇺🇸United States jrb Raleigh-Durham Area, NC, USA
In Drupal 10.1.4, the patch in #8 did not work for us. In
js/facets-views-ajax.js
,options.url
did not include the facets query string variables, so they were not getting sent in the URL that Ajax uses. I'm not sure if we're seeing something different from the people that #8 worked for or if maybe something changed in D10?In our case, our facet was using the variable
opp
and our exposed form had the variableskeys
andopen
. The URL that Ajax was using when facets were active was this (formatted for clarity):/views/ajax ?_wrapper_format=drupal_ajax &keys=test &open=0 &view_name=example_search &view_display_id=block_1 &view_args= &view_path=%2Fsearch-results &view_base_path=search-results &view_dom_id=c31d02539fca221547dc141fdacf4969d8c0193bd1c980cd824405906d9adf32 &pager_element=0 &_drupal_ajax=1 &ajax_page_state%5Btheme%5D=example &ajax_page_state%5Btheme_token%5D= &ajax_page_state%5Blibraries%5D=admin_toolbar%2Ftoolbar...
You can see that the URL there has
keys
andopen
, but is missing theopp
variable which was in the URL as&opp%5B0%5D=discipline%3A255&opp%5B1%5D=eligibility%3A414
at this time.We were able to fix this by adding code to
Drupal.Ajax.prototype.beforeSend()
that looks at the query string parameters inoptions.url
, compares them those to the ones in the current URL, and adds any that are missing.That's what this patch does.
- 🇯🇴Jordan n.ghunaim Amman - Jordan
This patch works with https://www.drupal.org/project/facets/issues/3052574#comment-15155405 🐛 Facets with AJAX not working in most of situations Needs review and D10.
- 🇨🇦Canada maursilveira Windsor, ON
I ran into this same issue, and the patch #14 fixes it.
- 🇺🇸United States vlyalko
this https://www.drupal.org/project/facets/issues/3052574#comment-15155405 🐛 Facets with AJAX not working in most of situations Needs review worked for me
- Assigned to shubhamsprasad
- Status changed to RTBC
7 months ago 7:39am 7 May 2024 - 🇮🇳India shubhamsprasad
Patch https://www.drupal.org/project/facets/issues/3168241#comment-15261500 → worked for me.
I have performed testing as well.
I have applied following patches along with it
"Facets with AJAX not working in most of situations(https://www.drupal.org/project/facets/issues/3052574)": "https://www.drupal.org/files/issues/2024-04-18/3052574-210.patch", "Ajax facet block seems to lose Views context (filters, etc)(https://www.drupal.org/project/facets/issues/2986981)": "https://www.drupal.org/files/issues/2023-04-26/ajax_facet_block_views_context-2986981-35.patch"
- Issue was unassigned.
- Status changed to Needs work
3 months ago 3:07pm 11 August 2024 - 🇺🇸United States lhridley
Patch / patches in #19 🐛 Facets and exposed filters don't work together with Ajax RTBC are not applying to:
* Drupal 10.3.2
* Facets 2.0.8I'm using Commerce Kickstart with Demo Commerce installed for testing. Issue is present with no patches, but patches from #19 do not apply.
Moving back to Needs Work