If a user uses a broken link to a site with facets without the facet id, the Query string URL processor gives a PHP warning:
Example broken link: http://example.com/nl/search?search_api_fulltext=in%20vitro%20techniek&i...
You see the id is missing from the facet parameter, but this should not cause a warning.
The warning:
Warning: Invalid argument supplied for foreach() in Drupal\facets\Plugin\facets\url_processor\QueryString->initializeActiveFilters() (line 180 of modules/contrib/facets/src/Plugin/facets/url_processor/QueryString.php).
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | broken_facet_link-2871475-5.patch | 1.76 KB | borisson_ |
Comments
Comment #2
borisson_I agree, we should be more defensive here, nice catch @jummonk!
Comment #3
borisson_Something like this should work, I added a test as well.
Comment #5
borisson_Patch no longer applied, reroll attached.
Comment #7
borisson_Fixed.
Comment #9
jummonk commentedPatch doesn't seem to solve it for me.
Error: [] operator not supported for strings in Drupal\facets\Plugin\facets\url_processor\QueryString->buildUrls() (line 106 of modules/contrib/facets/src/Plugin/facets/url_processor/QueryString.php).
On broken link example.be/nl/search?search_api_fulltext=in%20vitro%20techniek&items_per_page=10&f