0

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

1 Answer 1

0

Hah, I should've given the anonymous user the privilege to view the data.

Not the answer you're looking for? Browse other questions tagged or ask your own question.