diff --git a/core/lib/Drupal/Component/Annotation/Plugin.php b/core/lib/Drupal/Component/Annotation/Plugin.php index 790440d1129287dcdcdd1f615bd874f93dedb480..504ff401d1aa7653db23ddc7d65e4ca495ac2d1c 100644 --- a/core/lib/Drupal/Component/Annotation/Plugin.php +++ b/core/lib/Drupal/Component/Annotation/Plugin.php @@ -39,7 +39,7 @@ public function __construct($values) { return $value !== NULL; }); $parsed_values = $this->parse($values); - $this->definition = NestedArray::mergeDeep($defaults, $parsed_values); + $this->definition = NestedArray::mergeDeepArray([$defaults, $parsed_values], TRUE); } /** diff --git a/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php b/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php index d942764005faefbc1d6aa4fc4d332d22f99c25f1..554ed8dbeccd4ee868cc04c51b5e89d2621b2ae8 100644 --- a/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php +++ b/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php @@ -20,6 +20,7 @@ public function testGet() { // Assert all values are accepted through constructor and default value is // used for non existent but defined property. $plugin = new PluginStub([ + 1 => 'oak', 'foo' => 'bar', 'biz' => [ 'baz' => 'boom', @@ -32,6 +33,7 @@ public function testGet() { // This property wasn't in our definition but is defined as a property on // our plugin class. 'defaultProperty' => 'testvalue', + 1 => 'oak', 'foo' => 'bar', 'biz' => [ 'baz' => 'boom',