diff --git a/core/lib/Drupal/Core/Entity/EntityFieldManager.php b/core/lib/Drupal/Core/Entity/EntityFieldManager.php index 666b81f575af250a04f145a6dc4515b6a5ab598f..2b6b35cdc51f2611c2b9e57dacb67363ba5f2686 100644 --- a/core/lib/Drupal/Core/Entity/EntityFieldManager.php +++ b/core/lib/Drupal/Core/Entity/EntityFieldManager.php @@ -546,6 +546,22 @@ public function getFieldMap() { } } + // Complete the field map with extra bundle field info. + foreach ($this->fieldMap as $entity_type_id => $entity_field_map) { + $entity_type_bundles_list = $this->entityTypeBundleInfo->getBundleInfo($entity_type_id); + foreach (array_keys($entity_type_bundles_list) as $bundle_id) { + if ($bundle_id != 'default') { + $bundle_field_definitions = $this->getFieldDefinitions($entity_type_id, $bundle_id); + foreach ($bundle_field_definitions as $bundle_field_name => $bundle_field_definition) { + if (!isset($entity_field_map[$bundle_field_name])) { + $this->fieldMap[$entity_type_id][$bundle_field_name]['type'] = $bundle_field_definition->getType(); + $this->fieldMap[$entity_type_id][$bundle_field_name]['bundles'][$bundle_id] = $bundle_id; + } + } + } + } + } + $this->cacheSet($cid, $this->fieldMap, Cache::PERMANENT, ['entity_types', 'entity_field_info']); } }