EntityFieldManager::getFieldMap() doesn't show bundle fields

Created on 3 April 2019, over 5 years ago
Updated 16 July 2024, 5 months ago

Problem/Motivation

I add some bundle specific fields via hook_entity_bundle_field_info as should be controlled in code rather than config, but the entity type belongs to another module. However, although the tables are correctly created, the entity.definitions.bundle_field_map state key is never updated with the new fields. This means any future calls to \Drupal\Core\Entity\EntityFieldManager::getFieldMap are unaware of the field (despite it existing).

I think the two scenarios this causes problems are:

  • Module install for existing bundles
  • Bundle creation

I expect there is also going to be the reverse issue on module/bundle uninstall (bundle install may not matter too much).

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

None.

API changes

TBD

Data model changes

Probably none.

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
FieldΒ  β†’

Last updated 1 day ago

Created by

πŸ‡¬πŸ‡§United Kingdom andrewbelcher

Live updates comments and jobs are added and updated live.
  • Blocks-Layouts

    Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.71.5 2024