Problem/Motivation
Since PHP 8.5 beta3 using NULL as array offset produce deprication warning
Symfony fixed it via https://github.com/symfony/symfony/pull/61662
Steps to reproduce
https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_nul...
1 test triggered 1 PHP deprecation:
1) /builds/issue/drupal-3523596/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\Functional\Wizard\EntityTestRevisionTest::testRevisionsViewWithNoTypeOnBaseTable (28 times)
/builds/issue/drupal-3523596/core/modules/views/tests/src/Functional/Wizard/EntityTestRevisionTest.php:28
Proposed resolution
Use ?? '' workaround to make tests green
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3546535
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:
- 3546535-deal-with-null
changes, plain diff MR !13219
Comments
Comment #2
andypostComment #4
andypostAdded last commits from testing branch to simplify testing
Comment #5
andypostin MR from Meta issue all tests aree fixed, new needs to backport all of fixes
Comment #7
chi commentedCan we use
array_key_existsinstead ofisset?Comment #8
andypostneeds split into set of issues per component at least and debug each case
- Container could add typehint and remove broken tests
- NestaedArray needs to fix test and provide typehint
- Lazy collection needs to check for null and skip
- DiscoveryTrait.php should not allow null plugin
Comment #9
alexpottCreated #3554714: Add string typehint to \Drupal\Core\Authentication\AuthenticationCollectorInterface::getProvider()
Comment #10
alexpottCreated #3554723: Flood system needs to handle NULL identifiers
Comment #11
alexpottOpened #3555823: LanguageNegotiationContentEntity::getLangcode causes deprecations on PHP 8.5
Comment #12
alexpottCreated #3555828: \Drupal\Tests\system\Unit\Breadcrumbs\PathBasedBreadcrumbBuilderTest is triggering deprecations on PHP 8.5
Comment #13
alexpottOpened #3555836: \Drupal\Core\Menu\MenuActiveTrail causes deprecations on PHP 8.5
Comment #14
alexpottOpened #3555880: \Drupal\Tests\node\Unit\NodeOperationAccessTest::testRevisionOperations() triggers PHP 8.5 deprecation in \Drupal\Core\Entity\EntityAccessControlHandler::getCache()
Comment #15
alexpottAnd some more...
#3555881: \Drupal\Core\Theme\Icon\IconFinder::extractGroupFromPath() causes deprecations on PHP 8.5
#3555882: \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest triggers PHP 8.5 deprecations
#3555884: Drupal\Tests\Core\Entity\Sql\SqlContentEntityStorageTest::testCreate triggers PHP 8.5 deprecations
Comment #16
alexpottAnd...
#3555885: \Drupal\Tests\Core\Entity\TypedData\EntityAdapterUnitTest does not mock entity_type->getId() correctly triggering deprecations on PHP 8.5
#3555886: \Drupal\Tests\Core\Entity\ContentEntityBaseUnitTest does not mock EntityType::getId() correctly cuasing PHP 8.5 deprecations
Comment #17
alexpottAlso need to do:
Drupal\Tests\Core\Entity\EntityUrlTest
Drupal\Tests\Core\Config\Entity\ConfigEntityStorageTest
Drupal\Tests\migrate\Unit\process\StaticMapTest
See https://drupal-gitlab-job-artifacts.s3.us-west-2.amazonaws.com/7b/7c/7b7...
Comment #18
alexpottThe StaticMapTest should be covered by the existing issue - #3458923: StaticMap documents that NULL is a supported map value but causes an error - maybe we can drop support for it... not sure.
Added:
#3555918: \Drupal\Core\Entity\EntityBase::toUrl() triggers deprecations on PHP 8.5
#3555935: \Drupal\Tests\Core\Config\Entity\ConfigEntityStorageTest triggers deprecations on PHP. 8.5
I think that means all the issues from our unit tests on PHP 8.5 have issues.
Comment #19
mondrakeComment #20
andypostthe failure is caused by interface where NULL is expected array key and result
https://git.drupalcode.org/project/drupal/-/merge_requests/13219/diffs?c...
Comment #21
alexpottCreated #3557055: \Drupal\Core\Config\Schema\Mapping::getDynamicallyValidKeys() triggers a deprecation on PHP 8.5 - this will fix a tonne of deprecations in kernel tests...
and #3557056: Fix \Drupal\views_test_config\Hook\ViewsTestConfigHooks::viewLoad() on PHP 8.5
Comment #22
catchI think all of these are in now.
Comment #24
andypostTests show that only 2 dependency releases left to fix and composer 2.9.1 compatibility #3557585: Update to Composer 2.9.2
Confirm RTBC/Fixed!
TL'DR #3523596-66: [meta] PHP 8.5 support
Comment #25
alexpottLet's mark this as fixed as all the sub issues are and the tests are telling us this is so.