diff --git a/src/Entity/EntityBrowser.php b/src/Entity/EntityBrowser.php index 88bda9e..1381ef9 100644 --- a/src/Entity/EntityBrowser.php +++ b/src/Entity/EntityBrowser.php @@ -188,6 +188,7 @@ public function getDisplay() { */ protected function displayPluginCollection() { if (!$this->displayCollection) { + $this->display_configuration['instance_uuid'] = $this->uuid(); $this->display_configuration['entity_browser_id'] = $this->id(); $this->displayCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.entity_browser.display'), $this->display, $this->display_configuration); } diff --git a/src/Plugin/EntityBrowser/Display/IFrame.php b/src/Plugin/EntityBrowser/Display/IFrame.php index 8db37ee..67c00b6 100644 --- a/src/Plugin/EntityBrowser/Display/IFrame.php +++ b/src/Plugin/EntityBrowser/Display/IFrame.php @@ -128,7 +128,8 @@ public function defaultConfiguration() { */ public function displayEntityBrowser() { /** @var \Drupal\entity_browser\Events\RegisterJSCallbacks $event */ - $event = $this->eventDispatcher->dispatch(Events::REGISTER_JS_CALLBACKS, new RegisterJSCallbacks($this->configuration['entity_browser_id'])); + $callback_event = new RegisterJSCallbacks($this->configuration['entity_browser_id'], $this->configuration['instance_uuid']); + $event = $this->eventDispatcher->dispatch(Events::REGISTER_JS_CALLBACKS, $callback_event); $uuid = $this->getUuid(); $original_path = $this->currentPath->getPath(); return [ diff --git a/src/Plugin/EntityBrowser/Display/Modal.php b/src/Plugin/EntityBrowser/Display/Modal.php index 92f4545..c5446a0 100644 --- a/src/Plugin/EntityBrowser/Display/Modal.php +++ b/src/Plugin/EntityBrowser/Display/Modal.php @@ -117,7 +117,8 @@ public function defaultConfiguration() { */ public function displayEntityBrowser() { /** @var \Drupal\entity_browser\Events\RegisterJSCallbacks $event */ - $event = $this->eventDispatcher->dispatch(Events::REGISTER_JS_CALLBACKS, new RegisterJSCallbacks($this->configuration['entity_browser_id'])); + $callback_event = new RegisterJSCallbacks($this->configuration['entity_browser_id'], $this->configuration['instance_uuid']); + $event = $this->eventDispatcher->dispatch(Events::REGISTER_JS_CALLBACKS, $callback_event); $uuid = $this->getUuid(); $original_path = $this->currentPath->getPath(); return [