projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pull merge.
[yaffs-website]
/
web
/
core
/
lib
/
Drupal
/
Core
/
TypedData
/
TypedDataManager.php
diff --git
a/web/core/lib/Drupal/Core/TypedData/TypedDataManager.php
b/web/core/lib/Drupal/Core/TypedData/TypedDataManager.php
index 8c4f265ebdb4dfdb9a242dbab6fa2d29e2af44f0..9ac018c37efdb48cfd06d528e88542ea65311e49 100644
(file)
--- a/
web/core/lib/Drupal/Core/TypedData/TypedDataManager.php
+++ b/
web/core/lib/Drupal/Core/TypedData/TypedDataManager.php
@@
-117,7
+117,13
@@
class TypedDataManager extends DefaultPluginManager implements TypedDataManagerI
throw new \InvalidArgumentException("Invalid data type '$data_type' has been given");
}
$class = $type_definition['definition_class'];
throw new \InvalidArgumentException("Invalid data type '$data_type' has been given");
}
$class = $type_definition['definition_class'];
- return $class::createFromDataType($data_type);
+ $data_definition = $class::createFromDataType($data_type);
+
+ if (method_exists($data_definition, 'setTypedDataManager')) {
+ $data_definition->setTypedDataManager($this);
+ }
+
+ return $data_definition;
}
/**
}
/**
@@
-162,9
+168,8
@@
class TypedDataManager extends DefaultPluginManager implements TypedDataManagerI
// a shorter string than the serialized form, so array access is faster.
$parts[] = json_encode($settings);
}
// a shorter string than the serialized form, so array access is faster.
$parts[] = json_encode($settings);
}
- // Property path for the requested data object. When creating a list item,
- // use 0 in the key as all items look the same.
- $parts[] = $object->getPropertyPath() . '.' . (is_numeric($property_name) ? 0 : $property_name);
+ // Property path for the requested data object.
+ $parts[] = $object->getPropertyPath() . '.' . $property_name;
$key = implode(':', $parts);
// Create the prototype if needed.
$key = implode(':', $parts);
// Create the prototype if needed.
@@
-183,7
+188,7
@@
class TypedDataManager extends DefaultPluginManager implements TypedDataManagerI
throw new \InvalidArgumentException("Property $property_name is unknown.");
}
// Create the prototype without any value, but with initial parenting
throw new \InvalidArgumentException("Property $property_name is unknown.");
}
// Create the prototype without any value, but with initial parenting
- // so that constructors can set up the objects correc
lt
y.
+ // so that constructors can set up the objects correc
tl
y.
$this->prototypes[$key] = $this->create($definition, NULL, $property_name, $object);
}
$this->prototypes[$key] = $this->create($definition, NULL, $property_name, $object);
}