src/Plugin/EmbedType/Entity.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Plugin/EmbedType/Entity.php b/src/Plugin/EmbedType/Entity.php index 6854719..6e688c2 100644 --- a/src/Plugin/EmbedType/Entity.php +++ b/src/Plugin/EmbedType/Entity.php @@ -10,6 +10,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\PluginDependencyTrait; use Drupal\embed\EmbedType\EmbedTypeBase; +use Drupal\entity_browser\EntityBrowserInterface; use Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayManager; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -156,13 +157,10 @@ class Entity extends EmbedTypeBase implements ContainerFactoryPluginInterface { /** @var \Drupal\entity_browser\EntityBrowserInterface $item */ return $item->label(); }, - array_filter( - $browsers, - function ($item) { - /** @var \Drupal\entity_browser\EntityBrowserInterface $item */ - return $item->getDisplay() !== 'modal'; - } - ) + // Filter out both modal and standalone forms as they don't work. + array_filter($browsers, function (EntityBrowserInterface $browser) { + return !in_array($browser->getDisplay()->getPluginId(), ['modal', 'standalone'], TRUE); + }) ); $options = ['_none' => $this->t('None (autocomplete)')] + $browsers; $form['entity_browser'] = [