When $filter_key is NULL in LanguageSwitcherLinksAlterer::alter(), line 106 uses it as
an array offset ($link['query'][$filter_key]), triggering the PHP 8.5 deprecation:
"Using null as an array offset is deprecated, use an empty string instead".
Steps to reproduce:
1. Run Drupal on PHP 8.5 with Facets enabled
2. Use the language switcher on a page with faceted search
3. Observe the deprecation notice in logs
Expected: No deprecation notice.
Actual: Deprecated function: Using null as an array offset is deprecated in
Drupal\facets\LanguageSwitcherLinksAlterer->alter() (line 106).
Fix: add a $filter_key === NULL guard before the isset() check on line 106 of
src/LanguageSwitcherLinksAlterer.php.
Issue fork facets-3580885
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
paranojik commentedComment #5
strykaizer