summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/TypedData/TypedData.php
diff options
context:
space:
mode:
authorNathaniel Catchpole2014-06-05 10:27:09 (GMT)
committerNathaniel Catchpole2014-06-05 10:27:09 (GMT)
commit3bbaaa9b3940d13f3f22c91c709188a9c7be1438 (patch)
treeeeb449a4fb6f8619055b7a931aac9174a532f240 /core/lib/Drupal/Core/TypedData/TypedData.php
parent78d18c8da8be4c5d9457c9ae0f0a36871c323259 (diff)
Issue #2116341 by fago, tim.plunkett: Apply defaults to definition objects.
Diffstat (limited to 'core/lib/Drupal/Core/TypedData/TypedData.php')
-rw-r--r--core/lib/Drupal/Core/TypedData/TypedData.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/lib/Drupal/Core/TypedData/TypedData.php b/core/lib/Drupal/Core/TypedData/TypedData.php
index d113675..fce21d9 100644
--- a/core/lib/Drupal/Core/TypedData/TypedData.php
+++ b/core/lib/Drupal/Core/TypedData/TypedData.php
@@ -113,7 +113,12 @@ abstract class TypedData implements TypedDataInterface, PluginInspectionInterfac
*/
public function getConstraints() {
// @todo: Add the typed data manager as proper dependency.
- return \Drupal::typedDataManager()->getConstraints($this->definition);
+ $constraint_manager = \Drupal::typedDataManager()->getValidationConstraintManager();
+ $constraints = array();
+ foreach ($this->definition->getConstraints() as $name => $options) {
+ $constraints[] = $constraint_manager->create($name, $options);
+ }
+ return $constraints;
}
/**