I have the following structure in a content type:
. field_collection_parent (multiple value = 7)
.. computed field (single value)
.. field_collection_child (unlimited multiple value)
field_collection_parent represents the days of the week and field_collection_child are some work reports of each day. The computed field returns the day (monday, tuesday, etc.)
The problem is that I can have data in the first and thrid items of the field_collection_parent (that is Monday and Wednesday), but when I save the node, I only have two rows, because the second was empty, and computed returns Monday and Tuesday.
So, is it possible to get the weight of each field collection item although they were empty, and code it in the computed field?
P.D. I tried
$wrapper = entity_metadata_wrapper('field_collection_item', $entity); $entity_field['value'] = print_r($wrapper->delta(), true);
as indicated in "how to get weight or delta of current field collection item that is being computed" but it returns "Fatal error: Call to undefined method EntityDrupalWrapper::delta()"