Issue #3591430: Fix null Splide optionset label

Closes #3591430

The Splide admin optionset list escapes each optionset label before using it as a select option. Under PHP 8.1+, Html::escape() throws a TypeError when an optionset label is NULL.

This casts the label to string before escaping it and adds a unit test for a NULL-label optionset.

Credit to charlie59 for the original patches and reproduction.

Checked locally:

  • php -l src/Form/SplideAdmin.php
  • - php -l tests/src/Unit/Form/SplideAdminUnitTest.php
  • - php -l over all project PHP files
  • - composer validate --no-check-publish
  • - git diff --check

composer install --no-interaction could not be completed in this module-only checkout because Composer does not have the Drupal package repository configured for drupal/blazy.

Merge request reports

Loading
Loading