foreach() argument must be of type array|object

Created on 22 February 2024, about 1 year ago

Problem/Motivation

After a d7 to d10 migration, I'm getting this message each time I clean caches (drush cr) or on an operation where EntityFieldManager.php is called:
foreach() argument must be of type array|object, null given EntityFieldManager.php:539
Digging in EntityFieldManager.php it appears that the message entity_type_id is in cause.

        $bundle_field_maps = $this->keyValueFactory->get('entity.definitions.bundle_field_map')->getAll();
        foreach ($bundle_field_maps as $entity_type_id => $bundle_field_map) {
 (line 539)         foreach ($bundle_field_map as $field_name => $map_entry) {

Is there something wrong in entity.definitions ? apparently $bundle_field_maps ['message'] is empty.
I deleted all my old message templates coming from d7, I uninstalled message and message_examples, then I reinstalled them but the error appears again. No idea what is producing it.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇫🇷France erwangel

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

Comments & Activities

Production build 0.71.5 2024