Hi All,
I have this issue and don't know how to figure out. Thank for this great module by the way.

field_collection
field_item1: which is of type linkfield
field_item2: which is of type computedfield

How can I get the actual url under field_item1 in field_item2?

I did this under Computed Code (PHP) of field_item2

$entity_field[0]['value'] = array_pop(array_pop(field_get_items($entity_type, $entity, 'field_video_url')));

But it just print out a:0:{}, not the actual url enter under field_item1.

Thanks

Comments

truyenle’s picture

I think I got it.
Instead of
$entity_field[0]['value'] = array_pop(array_pop(field_get_items($entity_type, $entity, 'field_video_url')));
It should be
$entity_field[0]['value'] = array_pop(field_get_items($entity_type, $entity, 'field_video_url'))['url'];

Thanks

jmuzz’s picture

Issue summary: View changes
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.