summaryrefslogtreecommitdiffstats
path: root/core/modules/field_layout
diff options
context:
space:
mode:
authoreffulgentsia2017-02-08 21:28:13 (GMT)
committereffulgentsia2017-02-08 21:28:13 (GMT)
commit2fd6026a625c86f3031ab3686f6552ac36186f1e (patch)
treeb8e558f322a29addbe8ec60c2bdbfb812cdc926c /core/modules/field_layout
parentf2f688b89b9c2c497f271f3f75f8e7b3272e29cb (diff)
Issue #2821191 by tim.plunkett, tstoeckler, jibran: Allow object-based plugin definitions to be processed in PluginDependencyTrait
Diffstat (limited to 'core/modules/field_layout')
-rw-r--r--core/modules/field_layout/src/Entity/FieldLayoutEntityDisplayTrait.php21
1 files changed, 5 insertions, 16 deletions
diff --git a/core/modules/field_layout/src/Entity/FieldLayoutEntityDisplayTrait.php b/core/modules/field_layout/src/Entity/FieldLayoutEntityDisplayTrait.php
index 49da6a9..59377be 100644
--- a/core/modules/field_layout/src/Entity/FieldLayoutEntityDisplayTrait.php
+++ b/core/modules/field_layout/src/Entity/FieldLayoutEntityDisplayTrait.php
@@ -136,28 +136,17 @@ trait FieldLayoutEntityDisplayTrait {
/**
* Overrides \Drupal\Core\Entity\EntityDisplayBase::calculateDependencies().
*
- * @see \Drupal\Core\Plugin\PluginDependencyTrait::calculatePluginDependencies()
- *
- * @todo Remove once https://www.drupal.org/node/2821191 is resolved.
+ * Ensure the plugin dependencies are included. Once layouts are no longer
+ * stored as third party settings, this will be handled by the code in
+ * \Drupal\Core\Config\Entity\ConfigEntityBase::calculateDependencies() that
+ * handles \Drupal\Core\Entity\EntityWithPluginCollectionInterface.
*/
public function calculateDependencies() {
parent::calculateDependencies();
// This can be called during uninstallation, so check for a valid ID first.
if ($this->getLayoutId()) {
- /** @var \Drupal\Core\Layout\LayoutInterface $layout */
- $layout = $this->getLayout();
- $definition = $layout->getPluginDefinition();
-
- if (!in_array($definition->getProvider(), ['core', 'component'])) {
- $this->addDependency('module', $definition->getProvider());
- }
- if ($config_dependencies = $definition->getConfigDependencies()) {
- $this->addDependencies($config_dependencies);
- }
- if ($layout_dependencies = $layout->calculateDependencies()) {
- $this->addDependencies($layout_dependencies);
- }
+ $this->calculatePluginDependencies($this->getLayout());
}
}