- 🇩🇪Germany Elin Yordanov
I'm using this patch almost 7 years in multiple projects. I don't think it makes any sense to block this issue, because of missing tests.
Latest dev of entity_api and field_collection.
I have a node containing a field collection, with revisions enabled.
function mymodule_node_view($node, &$view_mode, $langcode) {
print 'NODE<br />';
print 'vid: ' . $node->vid . '<br />';
foreach ($node->field_field_collection[LANGUAGE_NONE] as $key => $collection) {
print $collection['revision_id'] . '<br />';
}
print '<br />WRAPPER<br />';
$wrapper = entity_metadata_wrapper('node', $node);
print 'vid: ' . $wrapper->vid->value() . '<br />';
foreach ($wrapper->field_field_collection as $key => $collection) {
print $collection->revision_id->value() . '<br />';
}
die;
}
Output:
When viewing the latest node revision:
NODE
vid: 273
255
256
257
WRAPPER
vid: 273
255
256
257
When viewing an older node revision:
NODE
vid: 271
221
222
223
WRAPPER
vid: 271
255
256
257
entity_metadata_wrapper is loading the latest revisions for the field collection, not the field collection revisions specified by the wrapped node entity.
1.0
Entity property wrapper
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I'm using this patch almost 7 years in multiple projects. I don't think it makes any sense to block this issue, because of missing tests.