Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
During kernel tests configuration is not installed for modules unless you call ->installConfig()
. This can cause deprecations in PHP 8.1 because code that expects the code to exist ends up passing a NULL to a string function.
Steps to reproduce
See test runs in #3220021: [meta] Ensure compatibility of Drupal 9 with PHP 8.1 (as it evolves) especially https://www.drupal.org/pift-ci-job/2120084
Proposed resolution
Install the configuration properly.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#2 | 3239292-2.patch | 4.72 KB | alexpott |
Comments
Comment #2
alexpottComment #3
daffie CreditAttribution: daffie commentedIs there a testbot run with the failures, so that I can see that the added code is necessary? Or some other way that I can make that determination?
Comment #4
alexpott@daffie it's not that simple - we're not passing on PHP 8.1 yet - hence the need to fix this. The tests fixed here fails in https://www.drupal.org/pift-ci-job/2120084 but there is plenty of other fails there too. All of the tests fixed here will have commits on that branch making it possible to find a test run prior to it being fixed. But there is a lot of noise.
Comment #5
alexpottI've just kicked off a test using PHP 8.1 and 9.3.x HEAD - https://www.drupal.org/pift-ci-job/2189809 - we should see the fails there - hopefully enough things having been fixed in HEAD to make that useful.
Comment #6
daffie CreditAttribution: daffie commented@alexpott: I have search the testbot results the IS/comment #4 and for AggregatorItemViewsFieldAccessTest I found the following errors:
Can you say that those errors will be gone when you do a testbot run with the patch from this issue is applied? I am not sure what kind of errors I should see? I would very much like to confirm that the patch fixes the problem and that we got all those missing configurations added.
Comment #7
alexpott@daffie it's really hard because we have deprecations on top of deprecations happening here. Personally I think that installing the config of a module when it's installed in a kernel test should not be optional. It's an optimisation which can lead to unexpected and incorrect testing as it is never true that a module is installed without its simple configuration. Sure config entities can be deleted but simple config is a singleton and should be able to be depended upon.
Comment #8
alexpottWhat we can confirm is that with these changes these tests are green when all the other fixes for PHP 8.1 are applied. That's why the meta exists.
Comment #9
andypost++ to have config of tested modules installed (more consistent testing)
Comment #11
catchCommitted e420029 and pushed to 9.3.x. Thanks!