Created
December 4, 2017 16:24
-
-
Save adamclark-dev/ee3198a737a87abe16772ba0df34e9da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Plugin/EntityBrowser/SelectionDisplay/View.php b/src/Plugin/EntityBrowser/SelectionDisplay/View.php | |
index 36fe12a..0b14c91 100644 | |
--- a/src/Plugin/EntityBrowser/SelectionDisplay/View.php | |
+++ b/src/Plugin/EntityBrowser/SelectionDisplay/View.php | |
@@ -123,9 +123,8 @@ class View extends SelectionDisplayBase { | |
*/ | |
public function calculateDependencies() { | |
$dependencies = []; | |
- if ($this->configuration['view']) { | |
- $view = ViewEntity::load($this->configuration['view']); | |
- $dependencies[$view->getConfigDependencyKey()] = [$view->getConfigDependencyName()]; | |
+ if ($this->configuration['view'] && ($view = ViewEntity::load($this->configuration['view']))) { | |
+ $dependencies[$view->getConfigDependencyKey()][] = $view->getConfigDependencyName(); | |
} | |
return $dependencies; | |
} | |
diff --git a/src/Plugin/EntityBrowser/Widget/View.php b/src/Plugin/EntityBrowser/Widget/View.php | |
index 605f782..a89f049 100644 | |
--- a/src/Plugin/EntityBrowser/Widget/View.php | |
+++ b/src/Plugin/EntityBrowser/Widget/View.php | |
@@ -272,9 +272,8 @@ class View extends WidgetBase implements ContainerFactoryPluginInterface { | |
*/ | |
public function calculateDependencies() { | |
$dependencies = []; | |
- if ($this->configuration['view']) { | |
- $view = ViewEntity::load($this->configuration['view']); | |
- $dependencies[$view->getConfigDependencyKey()] = [$view->getConfigDependencyName()]; | |
+ if ($this->configuration['view'] && ($view = ViewEntity::load($this->configuration['view'])) && method_exists($view, 'getConfigDependencyKey') ) { | |
+ $dependencies[$view->getConfigDependencyKey()][] = $view->getConfigDependencyName(); | |
} | |
return $dependencies; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment