If I embed an entity manually:

I still get an option to 'Edit Entity' if I right click on the widget:

However this leads to JS error:

POST http://drupal8.dev/entity-embed/dialog/entity-embed/full_html/undefined?_wrapper_format=drupal_modal 404 (Not Found)

Because there is no data-embed-button attribute on the element.

Comments

cs_shadow’s picture

Issue summary: View changes
cs_shadow’s picture

This is definitely a bug and might be slightly tricky to solve. Since {embed_button} in our routes is upcasted to its corresponding entity automatically, we can't simply use something like "BUTTON_NOT_DEFINED".

The only other option which seems feasible at the moment is adding a dummy button of sorts which we never display in the ckeditor configuration forms. This way, when the ParamConverter system tries to upcast the entity, it won't fail. This dummy button can be the default parameter for our routes so whenever data-embed-button is not defined, we use that button.

I realize this is not a very neat solution so would love more suggestions on this.

dave reid’s picture

Status: Active » Needs review

Actually, it looks like this was simpler than we thought to solve: https://github.com/drupal-media/entity_embed/pull/215

  • Dave Reid committed 4161b81 on 8.x-1.x
    Issue #2544018 by Dave Reid: Disable the 'Edit Entity' contextual menu...
dave reid’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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