- πΊπΈUnited States bkline Virginia
@berdir This issue was marked as a duplicate, but I can't find any identification of the other ticket of which this one was deemed to be a duplicate. Is it there and I just missed it?
Currently, EntityWrapper::getValue() relies on entity_load() and returns NULL if the entity hasn't been saved yet. This should be considered a bug because we need this to work with unsaved entities as well e.g. when passing a freshly created node object before saving it.
public function getValue() {
$source = $this->getIdSource();
$id = $source ? $source->getValue() : $this->id;
return $id ? entity_load($this->entityType, $id) : NULL;
}
Originally reported by EclipseGc (following snippet currently fails):
$node = entity_create('node', array('type' => 'page'));
$typed_data = typed_data()->create(
array(
'type' => 'entity',
'constraints' => array(
'EntityType' => 'node',
),
),
$node
);
drupal_set_message('<pre>' . var_export($typed_data->getValue(), TRUE) . '</pre>');
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
@berdir This issue was marked as a duplicate, but I can't find any identification of the other ticket of which this one was deemed to be a duplicate. Is it there and I just missed it?