core/lib/Drupal/Core/Entity/Entity.php | 7 +++++++ core/lib/Drupal/Core/Entity/EntityInterface.php | 11 +++++++++++ .../taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php | 2 +- .../taxonomy/src/Plugin/views/relationship/NodeTermData.php | 2 +- core/modules/user/src/Plugin/views/access/Role.php | 2 +- core/modules/views/src/Plugin/views/area/View.php | 2 +- .../views/src/Plugin/views/argument_validator/Entity.php | 3 +-- core/modules/views/src/Plugin/views/display/Page.php | 2 +- core/modules/views/src/Plugin/views/filter/Bundle.php | 3 +-- core/modules/views/src/Plugin/views/row/EntityRow.php | 2 +- core/modules/views/src/Plugin/views/row/RssPluginBase.php | 2 +- 11 files changed, 27 insertions(+), 11 deletions(-) diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index e582f0e..492a6aa 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -573,6 +573,13 @@ public function __sleep() { /** * {@inheritdoc} */ + public function getConfigDependencyKey() { + return $this->getEntityType()->getConfigDependencyKey(); + } + + /** + * {@inheritdoc} + */ public function getConfigDependencyName() { return $this->getEntityTypeId() . ':' . $this->bundle() . ':' . $this->uuid(); } diff --git a/core/lib/Drupal/Core/Entity/EntityInterface.php b/core/lib/Drupal/Core/Entity/EntityInterface.php index 674078d..d8e8e3e 100644 --- a/core/lib/Drupal/Core/Entity/EntityInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityInterface.php @@ -405,6 +405,17 @@ public function getTypedData(); public function getCacheTags(); /** + * Gets the key that is used to store configuration dependencies. + * + * @return string + * The key to be used in configuration dependencies when storing + * dependencies on entities of this type. + * + * @see \Drupal\Core\Entity\EntityTypeInterface::getConfigDependencyKey() + */ + public function getConfigDependencyKey(); + + /** * Gets the configuration dependency name. * * Configuration entities can depend on content and configuration entities. diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php index 9905272..bb991fb 100644 --- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php +++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php @@ -382,7 +382,7 @@ public function calculateDependencies() { $vocabulary = \Drupal::entityManager()->getStorage('taxonomy_vocabulary') ->load($this->options['vid']); - $dependencies['config'][] = $vocabulary->getConfigDependencyName(); + $dependencies[$vocabulary->getConfigDependencyKey()][] = $vocabulary->getConfigDependencyName(); return $dependencies; } diff --git a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php index ae325f9..333d773 100644 --- a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php +++ b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php @@ -112,7 +112,7 @@ public function calculateDependencies() { $vocabulary_storage = \Drupal::entityManager()->getStorage('taxonomy_vocabulary'); foreach (array_keys($this->options['vids']) as $vocabulary_id) { if ($vocabulary = $vocabulary_storage->load($vocabulary_id)) { - $dependencies['config'][] = $vocabulary->getConfigDependencyName(); + $dependencies[$vocabulary->getConfigDependencyKey()][] = $vocabulary->getConfigDependencyName(); } } diff --git a/core/modules/user/src/Plugin/views/access/Role.php b/core/modules/user/src/Plugin/views/access/Role.php index 1f3b0ab..fe58b87 100644 --- a/core/modules/user/src/Plugin/views/access/Role.php +++ b/core/modules/user/src/Plugin/views/access/Role.php @@ -101,7 +101,7 @@ public function calculateDependencies() { $role_storage = \Drupal::entityManager()->getStorage('user_role'); foreach (array_keys($this->options['role']) as $rid) { if ($role = $role_storage->load($rid)) { - $dependencies['config'][] = $role->getConfigDependencyName(); + $dependencies[$role->getConfigDependencyKey()][] = $role->getConfigDependencyName(); } } diff --git a/core/modules/views/src/Plugin/views/area/View.php b/core/modules/views/src/Plugin/views/area/View.php index 03f4ba5..ad2a975 100644 --- a/core/modules/views/src/Plugin/views/area/View.php +++ b/core/modules/views/src/Plugin/views/area/View.php @@ -160,7 +160,7 @@ public function calculateDependencies() { list($view_id, $display_id) = explode(':', $this->options['view_to_insert']); if ($view_id) { $view = \Drupal::entityManager()->getStorage('view')->load($view_id); - $dependencies['config'][] = $view->getConfigDependencyName(); + $dependencies[$view->getConfigDependencyKey()][] = $view->getConfigDependencyName(); } return $dependencies; diff --git a/core/modules/views/src/Plugin/views/argument_validator/Entity.php b/core/modules/views/src/Plugin/views/argument_validator/Entity.php index d34706f..4638171 100644 --- a/core/modules/views/src/Plugin/views/argument_validator/Entity.php +++ b/core/modules/views/src/Plugin/views/argument_validator/Entity.php @@ -224,8 +224,7 @@ public function calculateDependencies() { foreach (array_keys($this->options['bundles']) as $bundle) { $bundle_entity = $bundle_entity_storage->load($bundle); - $key = $bundle_entity->getEntityType()->getConfigDependencyKey(); - $dependencies[$key][] = $bundle_entity->getConfigDependencyName(); + $dependencies[$bundle_entity->getConfigDependencyKey()][] = $bundle_entity->getConfigDependencyName(); } return $dependencies; diff --git a/core/modules/views/src/Plugin/views/display/Page.php b/core/modules/views/src/Plugin/views/display/Page.php index 8837160..8307482 100644 --- a/core/modules/views/src/Plugin/views/display/Page.php +++ b/core/modules/views/src/Plugin/views/display/Page.php @@ -435,7 +435,7 @@ public function calculateDependencies() { $menu = $this->getOption('menu'); if ($menu['type'] === 'normal') { $menu_entity = \Drupal::entityManager()->getStorage('menu')->load($menu['menu_name']); - $dependencies['config'][] = $menu_entity->getConfigDependencyName(); + $dependencies[$menu_entity->getConfigDependencyKey()][] = $menu_entity->getConfigDependencyName(); } return $dependencies; diff --git a/core/modules/views/src/Plugin/views/filter/Bundle.php b/core/modules/views/src/Plugin/views/filter/Bundle.php index 6e96568..13853ef 100644 --- a/core/modules/views/src/Plugin/views/filter/Bundle.php +++ b/core/modules/views/src/Plugin/views/filter/Bundle.php @@ -85,8 +85,7 @@ public function calculateDependencies() { foreach (array_keys($this->value) as $bundle) { $bundle_entity = $bundle_entity_storage->load($bundle); - $key = $bundle_entity->getEntityType()->getConfigDependencyKey(); - $dependencies[$key][] = $bundle_entity->getConfigDependencyName(); + $dependencies[$bundle_entity->getConfigDependencyKey()][] = $bundle_entity->getConfigDependencyName(); } return $dependencies; diff --git a/core/modules/views/src/Plugin/views/row/EntityRow.php b/core/modules/views/src/Plugin/views/row/EntityRow.php index f36cb10..eee2e27 100644 --- a/core/modules/views/src/Plugin/views/row/EntityRow.php +++ b/core/modules/views/src/Plugin/views/row/EntityRow.php @@ -223,7 +223,7 @@ public function calculateDependencies() { ->getStorage('entity_view_mode') ->load($this->entityTypeId . '.' . $this->options['view_mode']); if ($view_mode) { - $dependencies['config'][] = $view_mode->getConfigDependencyName(); + $dependencies[$view_mode->getConfigDependencyKey()][] = $view_mode->getConfigDependencyName(); } return $dependencies; diff --git a/core/modules/views/src/Plugin/views/row/RssPluginBase.php b/core/modules/views/src/Plugin/views/row/RssPluginBase.php index 7ed7f7c..6a06c13 100644 --- a/core/modules/views/src/Plugin/views/row/RssPluginBase.php +++ b/core/modules/views/src/Plugin/views/row/RssPluginBase.php @@ -68,7 +68,7 @@ public function calculateDependencies() { ->getStorage('entity_view_mode') ->load($this->entityTypeId . '.' . $this->options['view_mode']); if ($view_mode) { - $dependencies['config'][] = $view_mode->getConfigDependencyName(); + $dependencies[$view_mode->getConfigDependencyKey()][] = $view_mode->getConfigDependencyName(); } return $dependencies;