https://www.drupal.org/node/2736741 introduced view modes replacing rendered entity formatter.

With this new behaviour contact_form entities can no longer be embedded, because rendered entity setting is not available anymore. These are configuration entites with a ViewBuilder provided by contact_storage module, using rendered_entity_mode=TRUE works fine, also using core entity_reference field still works. Maybe configuration entities should be treated differently, or can there be anything done in contact_storage module?

Comments

volkerk created an issue. See original summary.

volkerk’s picture

dave reid’s picture

This was my hesitation at splitting up the 'Rendered entity' formatter into a plugin for each view mode, we cannot assume that a renderable entity actually has any view modes, but it should *always* be able to render using the default view mode.

dave reid’s picture

Priority: Normal » Major
volkerk’s picture

So, implementing hook_entity_embed_display_plugins_for_context_alter fixes the behaviour for the moment:

function hook_entity_embed_display_plugins_for_context_alter(array &$definitions, array $context) {
  if ($context['entity_type'] === 'contact_form') {
    $definitions['entity_reference:entity_reference_entity_view']['no_ui'] = FALSE;
  }
}
wim leers’s picture

Status: Active » Closed (works as designed)
Related issues: +#2748581: Embedding core Contact forms