diff --git a/core/lib/Drupal/Core/TypedData/TypedDataManager.php b/core/lib/Drupal/Core/TypedData/TypedDataManager.php index e48b078..243d02a 100644 --- a/core/lib/Drupal/Core/TypedData/TypedDataManager.php +++ b/core/lib/Drupal/Core/TypedData/TypedDataManager.php @@ -253,6 +253,9 @@ public function getPropertyInstance(TypedDataInterface $object, $property_name, if ($definition instanceof ListDataDefinition) { $definition = $definition->getItemDefinition(); } + // We consider we can reuse an existing prototype if it was built: + // - for the same runtime $definition object, + // - and for the same parent hiararchy. $key = spl_object_hash($definition) . '.'; $key .= ':' . $object->getPropertyPath() . '.'; // If we are creating list items, we always use 0 in the key as all list