Change Entity Value In hook_feeds_presave() I am trying to modify data coming from a feed before it saved to a node by using hook_feeds_presave().

I have code that looks like this:

my_module_feeds_presave(FeedsSource $source, $entity, $item) {
     $email =  $item['email address'];
    //Remove "NOT GIVEN" from the email column to stop errors
    if($email == "NOT GIVEN"){
        $entity-&gt;field_email['und'][0]['value'] = '';
    } 
}


I would think that when the node is saved that value in the email filed would be blank. However, it is still saving the value of NOT GIVEN.

If anyone can please point me in the right direction with this I would appreciate it.

Thanks,

Josh
Can you mention your Drupal version?


For Drupal 7, your code looks good enough at a first glance.
If it's Drupal 8, all you need is $entity-&gt;field_email = ''.


If that doesn't work, leave a comment and I'll take a detailed look.