Problem/Motivation
This came up in #2546212: [PP-1] Entity view/form mode formatter/widget settings have no translation UI. We want to translate node displays on the node type translation form, but we cannot just attach *all* node displays to the mapper alltogether, but we need to dynamically attach those displays that belong to the node type that is currently being translated. And we cannot do this in a dedicated mapper, because we need to do this generically from Field UI module for all entity types.
I.e. when ConfigEntityMapper::setEntity()
is called for the node type mapper, it ends up setting the node.type.article
config name, for example. We need to somehow hook into that from Field UI and also attach core.entity_view_display.node.article.teaser
for example.
This is blocking a major bug, so is tagged as major as well.
Proposed resolution
Have config_translation module dispatch an event when populateFromRouteMatch() is called so that other modules can subscribe to the event and add config names to the config mapper.
Remaining tasks
Review.
Evaluate if we need the route match in the event. See this comment for a reason why we should.
User interface changes
None.
API changes
Additions:
- New event (ConfigMapperPopulateEvent)
- New argument (optional for BC) for ConfigNamesMapper & ConfigEntityMapper ($event_dispatcher)
Data model changes
None.