2

I've got a field collection, which contains

  1. A copy field
  2. A user field, via entity reference

Now when I try to access the copy field by storing the collection in $collection, via

$collection->field_my_collection_copy->value();

I get what im looking for, but trying similar on the entity referenced field

$collection->field_my_collection_user->value();

It breaks. By looking into the variables for $collection->field_my_collection_user I should have 'uid' available on it, but $collection->field_my_collection_user->uid gives me nothing and $collection->field_my_collection_user->uid->value(); gives me Unable to get the data property uid as the parent data structure is not set

Kasper
  • 1,282
  • 4
  • 20
  • 39

1 Answers1

0

It could be because Field Collection doesn't inherently know what node type their parent is associated with.

jsheffers
  • 1,602
  • 19
  • 41