diff --git a/core/lib/Drupal/Core/TypedData/Validation/EntityMetadata.php b/core/lib/Drupal/Core/TypedData/Validation/EntityMetadata.php deleted file mode 100644 index d33de7a..0000000 --- a/core/lib/Drupal/Core/TypedData/Validation/EntityMetadata.php +++ /dev/null @@ -1,24 +0,0 @@ -getConstraints(); + return $this->constraints; } /** @@ -131,21 +132,14 @@ public function getConstrainedProperties() { * {@inheritdoc} */ public function getCascadingStrategy() { - // If we have property constraints, we need to cascade. - if ($this->propertyConstraints) { - return CascadingStrategy::CASCADE; + foreach ($this->getConstrainedProperties() as $property_name) { + foreach ($this->getPropertyMetadata($property_name) as $metadata) { + if ($metadata->findConstraints(Constraint::DEFAULT_GROUP)) { + return CascadingStrategy::CASCADE; + } + } } return CascadingStrategy::NONE; } - /** - * {@inheritdoc} - */ - public function getTraversalStrategy() { - if ($this->typedData instanceof ListInterface) { - return TraversalStrategy::IMPLICIT; - } - return parent::getTraversalStrategy(); - } - }