diff --git a/core/lib/Drupal/Core/TypedData/TypedDataManager.php b/core/lib/Drupal/Core/TypedData/TypedDataManager.php index 9ac018c37efdb48cfd06d528e88542ea65311e49..aab5850ada178d044a4a1bff339947c2dad1c8d4 100644 --- a/core/lib/Drupal/Core/TypedData/TypedDataManager.php +++ b/core/lib/Drupal/Core/TypedData/TypedDataManager.php @@ -169,7 +169,15 @@ public function getPropertyInstance(TypedDataInterface $object, $property_name, $parts[] = json_encode($settings); } // Property path for the requested data object. - $parts[] = $object->getPropertyPath() . '.' . $property_name; + $parts[] = $object->getPropertyPath(); + // Only property instances of complex data types should be cached by the + // property name, as they represent different properties. Properties of list + // data types are the items of the list and the property name represents + // only the delta in that list and not an unique property, which is why all + // items should use the same prototype. + if ($object instanceof ComplexDataInterface) { + $parts[] = $property_name; + } $key = implode(':', $parts); // Create the prototype if needed.