Problem/Motivation
Drupal\Tests\views\Kernel\ThirdPartyUninstallTest triggers a deprecation in config schema on PHP 8.5.
Steps to reproduce
Run Drupal\Tests\views\Kernel\ThirdPartyUninstallTest and see
Third Party Uninstall (Drupal\Tests\views\Kernel\ThirdPartyUninstall)
⚠ Third party uninstall
1 test triggered 2 PHP deprecations:
1) /builds/issue/drupal-3458923/core/lib/Drupal/Core/Config/Schema/Mapping.php:185
Using null as an array offset is deprecated, use an empty string instead
Triggered by:
* Drupal\Tests\views\Kernel\ThirdPartyUninstallTest::testThirdPartyUninstall (42 times)
/builds/issue/drupal-3458923/core/modules/views/tests/src/Kernel/ThirdPartyUninstallTest.php:43
2) /builds/issue/drupal-3458923/core/modules/views/tests/modules/views_test_config/src/Hook/ViewsTestConfigHooks.php:24
Using null as an array offset is deprecated, use an empty string instead
Triggered by:
* Drupal\Tests\views\Kernel\ThirdPartyUninstallTest::testThirdPartyUninstall (29 times)
/builds/issue/drupal-3458923/core/modules/views/tests/src/Kernel/ThirdPartyUninstallTest.php:43
NOTE: We are only fixing one of the deprecations in this issue.
Proposed resolution
Don't do unnecessary array work when fallback value is NULL.
Remaining tasks
User interface changes
None
Introduced terminology
N/a
API changes
None
Data model changes
None
Release notes snippet
N/a
Comments
Comment #2
alexpottComment #4
alexpottComment #5
andypostI bet it will fix more then this test, guess it needs Wim's approval
Comment #6
alexpott@andypost the code is equivalent - there's no actual change here. For the same inputs you get the same outputs. It is just more efficient.
Yes it fixes more tests that trigger the same deprecation. But it is not a bug fix.
Comment #7
andypostYes, it's more efficient then I did! Let's unblock remains
Comment #8
longwaveCommitted and pushed c5aeab53a01 to 11.x and 61189f33d47 to 11.3.x. Thanks!