Deprecations in \Drupal\Core\Entity\EntityStorageBase::mapFromStorageRecords() on PHP 8.5

Created on 12 November 2025, 4 days ago
Updated 13 November 2025, 3 days ago

Problem/Motivation

There are two reason this happens:
One, ff you run Drupal\KernelTests\Core\KeyValueStore\KeyValueContentEntityStorageTest you get deprecation errors in \Drupal\Core\Entity\EntityStorageBase::mapFromStorageRecords on PHP 8.5. because key value storage is broken.

Also, if a config entity is installed without an ID this will occur.

Steps to reproduce

Run \Drupal\KernelTests\Core\KeyValueStore\KeyValueContentEntityStorageTest
Run \Drupal\Tests\system\Functional\Module\UninstallTest::testFailedInstallStatus

Proposed resolution

The deprecations are triggered by the key value storage because its loadMultiple() is fundamentally broken. We have to fix this in 11.x but we could consider deprecating and removing in 12.x - see #2618436: Complete the KV content entity storage implementation β†’

Installing the module_installer_config_test module is supposed to fail because of a missing ID. However before it gets to \Drupal\Core\Config\Entity\ConfigEntityStorage::save() where it throws an exception it get to \Drupal\Core\Entity\EntityStorageBase::mapFromStorageRecords() where it tries to using NULL as an ID. We should throw an exception in mapFromStorageRecords() if $entity->id() is NULL - this is always unexpected.

Remaining tasks

User interface changes

None

Introduced terminology

N/a

API changes

None

Data model changes

None

Release notes snippet

N/a

πŸ› Bug report
Status

Needs review

Version

11.0 πŸ”₯

Component

entity system

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024