diff --git a/core/lib/Drupal/Component/Annotation/Plugin.php b/core/lib/Drupal/Component/Annotation/Plugin.php index 751eb20..32535ad 100644 --- a/core/lib/Drupal/Component/Annotation/Plugin.php +++ b/core/lib/Drupal/Component/Annotation/Plugin.php @@ -7,6 +7,8 @@ namespace Drupal\Component\Annotation; +use Drupal\Component\Utility\NestedArray; + /** * Defines a Plugin annotation object. * @@ -34,7 +36,11 @@ class Plugin implements AnnotationInterface { * classed annotations that were used. */ public function __construct($values) { - $this->definition = $this->parse($values); + $defaults = new \ReflectionClass($this)->getDefaultProperties(); + // Remove the protected $definiton from the defaults. + unset($defaults['definition']); + $parsed_values = $this->parse($values); + $this->definition = NestedArray::mergeDeep($defaults, $parsed_values); } /** diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index 7ad6f62..a514572 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -40,29 +40,6 @@ class EntityManager extends PluginManagerBase { protected $controllers = array(); /** - * The default values for optional keys of the entity plugin definition. - * - * @var array - */ - protected $defaults = array( - 'controller_class' => 'Drupal\Core\Entity\DatabaseStorageController', - 'entity_keys' => array( - 'revision' => '', - 'bundle' => '', - ), - 'fieldable' => FALSE, - 'field_cache' => TRUE, - 'form_controller_class' => array( - 'default' => 'Drupal\Core\Entity\EntityFormController', - ), - 'list_controller_class' => 'Drupal\Core\Entity\EntityListController', - 'access_controller_class' => 'Drupal\Core\Entity\EntityAccessController', - 'static_cache' => TRUE, - 'translation' => array(), - 'permission_granularity' => 'entity_type', - ); - - /** * Constructs a new Entity plugin manager. * * @param array $namespaces @@ -86,8 +63,6 @@ public function __construct(array $namespaces) { * Overrides Drupal\Component\Plugin\PluginManagerBase::processDefinition(). */ public function processDefinition(&$definition, $plugin_id) { - parent::processDefinition($definition, $plugin_id); - // Prepare entity schema fields SQL info for // Drupal\Core\Entity\DatabaseStorageControllerInterface::buildQuery(). if (isset($definition['base_table'])) {