- 🇧🇪Belgium borisson_ Mechelen, 🇧🇪
I don't understand the actions we'd need to do to hep with this issue. Closing this
Hi guys, thanks for the great job!
change condition query options, recovers f=null
#before
// Because we can't get the desired url trough a url processor method
// we iterate each result url and remove the facet params that haven't
// been used on previous crumbs.
foreach ($facet_results as $res) {
$facet_url = $res->getUrl();
/** @var \Drupal\Core\Url $facet_url */
$query = $facet_url->getOption('query');
$filter_key = $facet_source->getFilterKey() ?: 'f';
$source_filter = $query[$filter_key];
$source_filter = array_unique($source_filter);
$source_filter = array_filter($source_filter);
$matches = preg_grep('/^' . implode('|^', $facet_used_result) . '/', $source_filter);
$query[$filter_key] = $matches;
$facet_crumb_items[] = $res->getDisplayValue();
}
#after
// Because we can't get the desired url trough a url processor method
// we iterate each result url and remove the facet params that haven't
// been used on previous crumbs.
foreach ($facet_results as $res) {
$facet_url = $res->getUrl();
/** @var \Drupal\Core\Url $facet_url */
$query = $facet_url->getOption('query');
if($facet_source->getFilterKey()){
$filter_key = $facet_source->getFilterKey();
$source_filter = $query[$filter_key];
$source_filter = array_unique($source_filter);
$source_filter = array_filter($source_filter);
$matches = preg_grep('/^' . implode('|^', $facet_used_result) . '/', $source_filter);
$query[$filter_key] = $matches;
}
$facet_crumb_items[] = $res->getDisplayValue();
}
if create custom url processor /admin/config/search/facets/facet-sources/search_api_you_facet_source/edit
and select facet value in breadcrumb /catalog/you_facet_alias/you_facet_value?f
Here is this line $filter_key = $facet_source->getFilterKey() ?: 'f';
Why do I need 'f'
i'm not undestand
What do you think?
ty
Closed: cannot reproduce
Code
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I don't understand the actions we'd need to do to hep with this issue. Closing this