fix: #3639007 TranslateFilterForm uses a NULL filter default as an array key

Issue: https://www.drupal.org/i/3639007

With no translatable language, the language filter default is NULL. TranslateFilterForm::buildForm() uses it as an array key and passes it on as #empty_value, so PHP 8.5 logs "Using null as an array offset is deprecated" twice: at TranslateFilterForm.php:47 and in Select::processSelect(). The default now falls back to '', which is the key PHP already cast NULL to, so the rendered select does not change.

New kernel test TranslateFilterFormTest fails without the fix on any PHP version (#empty_value is NULL) and reports both deprecations on 8.5. Checked on a Drupal 11.4.12 site on PHP 8.5: both log entries for /admin/config/regional/translate are gone with the fix.

AI-Generated: Yes (Claude Code)

Checkpoints:

  • File an issue
  • Addition/Change/Update/Fix
  • Testing to ensure no regression
  • Automated unit testing coverage
  • Automated functional testing coverage
  • UX/UI designer responsibilities
  • Readability
  • Accessibility
  • Performance
  • Security
  • Developer Documentation
  • User Guide Documentation
  • Reviewed by human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Release notes snippet
  • Release

Merge request reports

Loading
Loading