I have a situation where I am trying to clone a node field after importing content via feeds. I am doing this because of a challenge I have with feeds_tamper_string_2Id module. I have tried the following code but it didn't work
function members_entity_presave($entity, $type)
{
if($entity->type == 'members') {
foreach ($entity->field_tags2['und'] as $tags) {
array_push($entity->field_tags_people['und'], $tags);
}
}
}
I want to copy the values of field_tags2['und'] into field_tag_people['und'].
If your field is a taxonomy reference you can try this :
EDIT
You can use entity_metadata_wrapper : https://www.drupal.org/docs/7/api/entity-api/entity-metadata-wrappers