Not sure if this is a bug. But Every time I try to set the value of a field in the following way
$wrapper->field_somefield->value->set($somevalue);
I get fatal error Call to a member function set() on a non-object
I tried the same thing on native body field for article and it works.
$wrapper->body->value->set($somevalue);
Is there something wrong?
Thanks
Comments
Comment #1
diego21 commentedThat's not the correct way to use entity_metadata_wrapper for set values for fields. Check that link:
http://drupal.stackexchange.com/questions/69526/how-to-set-value-of-file-field-with-entity-metadata-wrapper
$wrapper->body is an EntityStructureWrapper.
$wrapper->field_somefield is an EntityDrupalWrapper.
I'm going to set the status to fixed.