Commit 4cd0a186 authored by oknate's avatar oknate Committed by phenaproxima

Issue #2766983 by oknate, alexpott, phenaproxima: [entity_browser][config...

Issue #2766983 by oknate, alexpott, phenaproxima: [entity_browser][config dependencies] Missing configuration dependency on entity browser in \Drupal\entity_embed\Plugin\EmbedType\Entity
parent 2bc72b07
......@@ -298,6 +298,16 @@ class Entity extends EmbedTypeBase implements ContainerFactoryPluginInterface {
$this->calculatePluginDependencies($instance);
}
$entity_browser = $this->getConfigurationValue('entity_browser');
if ($entity_browser && $this->entityTypeManager->hasDefinition('entity_browser')) {
$browser = $this->entityTypeManager
->getStorage('entity_browser')
->load($entity_browser);
if ($browser) {
$this->addDependency($browser->getConfigDependencyKey(), $browser->getConfigDependencyName());
}
}
return $this->dependencies;
}
......
......@@ -56,8 +56,12 @@ class EntityEmbedEntityBrowserTest extends EntityEmbedDialogTest {
$embed_button->type_settings['entity_browser'] = 'entity_embed_entity_browser_test';
$embed_button->save();
// Rebuild routes, so the route called by getEmbedDialog() exists.
$this->container->get('router.builder')->rebuild();
$dependencies = $embed_button->getDependencies();
$this->assertContains('entity_browser.browser.entity_embed_entity_browser_test', $dependencies['config']);
$this->getEmbedDialog('custom_format', 'node');
$this->assertResponse(200, 'Embed dialog is accessible with custom filter format and default embed button.');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment