Skip to main content
Tweeted twitter.com/StackDrupal/status/708243840013115392
added 2 characters in body; edited tags
Source Link
kenorb
  • 14.3k
  • 10
  • 98
  • 168

I'm trying to programmatically set a value on a field collection item attached to the user entity.

The field collection field in question is titled, "field_user_location"field_user_location.

I initially had this ($usr_wrapper being an entity metadata wrapper of the user entity)

$usr_wrapper->field_user_location->field_land_phone->set($object['Phone Number']);

However that doesn't appear to work.

How do you get data onto a field collection via entity_metadata_wrapper()entity_metadata_wrapper()? There isn't much documentation about how to do this that I am seeing.

I'm trying to programmatically set a value on a field collection item attached to the user entity.

The field collection field in question is titled, "field_user_location".

I initially had this ($usr_wrapper being an entity metadata wrapper of the user entity)

$usr_wrapper->field_user_location->field_land_phone->set($object['Phone Number']);

However that doesn't appear to work.

How do you get data onto a field collection via entity_metadata_wrapper()? There isn't much documentation about how to do this that I am seeing.

I'm trying to programmatically set a value on a field collection item attached to the user entity.

The field collection field in question is titled, field_user_location.

I initially had this ($usr_wrapper being an entity metadata wrapper of the user entity)

$usr_wrapper->field_user_location->field_land_phone->set($object['Phone Number']);

However that doesn't appear to work.

How do you get data onto a field collection via entity_metadata_wrapper()? There isn't much documentation about how to do this that I am seeing.

Source Link
Jack Ryan
  • 2.3k
  • 4
  • 32
  • 56

How to set a value on a field collection using entity metadata wrapper

I'm trying to programmatically set a value on a field collection item attached to the user entity.

The field collection field in question is titled, "field_user_location".

I initially had this ($usr_wrapper being an entity metadata wrapper of the user entity)

$usr_wrapper->field_user_location->field_land_phone->set($object['Phone Number']);

However that doesn't appear to work.

How do you get data onto a field collection via entity_metadata_wrapper()? There isn't much documentation about how to do this that I am seeing.