diff --git a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php index 7a9ab61..0096257 100644 --- a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php +++ b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php @@ -73,6 +73,8 @@ public function getDefinition($plugin_id, $exception_on_invalid = TRUE) { else { $plugin_definition = $derivative_plugin_definition; } + // It is vital that derivative plugin definitions contain derivative + // plugin IDs. Enforce it here, because not all derivers do it. $plugin_definition['id'] = $plugin_id; } } @@ -111,6 +113,8 @@ protected function getDerivatives(array $base_plugin_definitions) { if ($derivative_id && isset($base_plugin_definitions[$plugin_id])) { $derivative_definition = $this->mergeDerivativeDefinition($base_plugin_definitions[$plugin_id], $derivative_definition); } + // It is vital that derivative plugin definitions contain derivative + // plugin IDs. Enforce it here, because not all derivers do it. $derivative_definition['id'] = $plugin_id; $plugin_definitions[$plugin_id] = $derivative_definition; }