Entity embed currently hard codes disabling entity_reference_entity_view plugin. This is because the 'view_mode' EntityEmbedDisplay plugin is intended to replace it wholesale (Implemented in #2736741: Treat each view mode in "Rendered entity" formatter as a standalone formatter). However in some cases it can be useful for the plugin to be enabled, for entities that do not implement view modes, namely configuration entity types. And in my use case, specifically the Webform configuration entity type. Webform implements the standard view_builder handler system, and can be displayed with regular entity_reference_entity_view formatters.

Other related issues, especially for cores' contact.module have closed similar issues as works-as-designed. I can speak from experience that embedding things like Webform via entity_reference_entity_view formatter for an entity_reference field have worked with success. In my use case it was for a Paragraph, however I'd like to get away from Paragraphs and use Entity Embed.

Comments

dpi created an issue. See original summary.

dpi’s picture

Assigned: dpi » Unassigned
Status: Active » Needs review
StatusFileSize
new5.63 KB

Im proposing removing the no_ui hardcoded workaround for this plugin type, and replacing it with an implementation of \Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayInterface::access, wherein we decide at runtime whether the plugin is applicable for the entity type in context.

The result of this patch is: Entity embed buttons for content entity types: no change, Entity embed for configuration entity types: "Rendered entity" plugin now visible in button "Allowed Entity Embed Display plugins" checkbox selection on button config form, and "Display as" dropdown when inserting/editing configuration embeds

Behaviour of rendered_entity_mode config is retained.

dpi’s picture

FWIW I'm in disagreement with #2748581-20: Embedding core Contact forms. The project already exposes configuration entities when adding button entities, why not allow this.

dpi’s picture

StatusFileSize
new5.63 KB

Rebased on HEAD.

Status: Needs review » Needs work

The last submitted patch, 5: 3046480-config-embeds-5.patch, failed testing. View results

dpi’s picture

Status: Needs work » Needs review
StatusFileSize
new1.51 KB
new5.63 KB

CS + a different context is available depending on form/render caller

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

FWIW I'm in disagreement with #2748581-20: Embedding core Contact forms.

I wrote that comment :) You'll be happy to hear that #3055050: Loosen EntityEmbedFilter's greedy exception capture: catch only relevant exceptions landed earlier today and fixed that same problem.

The project already exposes configuration entities when adding button entities, why not allow this.

This is a very good point.

Manually tested, works as expected and advertised 👍

wim leers’s picture

StatusFileSize
new1.86 KB
new6.11 KB

Fix coding standards issues and a typo.

  • Wim Leers committed 4abc101 on 8.x-1.x authored by dpi
    Issue #3046480 by dpi, Wim Leers: Re-enable 'Rendered entity' formatter...
wim leers’s picture

Status: Reviewed & tested by the community » Fixed

🚢

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.