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

Issue fork drupal-3557333

Command icon 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:

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Issue summary: View changes

alexpott’s picture

Status: Active » Needs review
alexpott’s picture

Title: \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage causes deprecations in \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage::mapFromStorageRecords() on PHP 8.5 » Deprecations in \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage::mapFromStorageRecords() on PHP 8.5
Issue summary: View changes
alexpott’s picture

Title: Deprecations in \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage::mapFromStorageRecords() on PHP 8.5 » Deprecations in \Drupal\Core\Entity\EntityStorageBase::mapFromStorageRecords() on PHP 8.5
andypost’s picture

just a nitpick to clean-up

andypost’s picture

Status: Needs review » Reviewed & tested by the community

ready to go

catch’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 11.3.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • catch committed 946903d0 on 11.x
    fix: #3557333 Deprecations in \Drupal\Core\Entity\EntityStorageBase::...

  • alexpott committed 74bdbe01 on 11.3.x authored by catch
    fix: #3557333 Deprecations in \Drupal\Core\Entity\EntityStorageBase::...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.