change entityform value via function before save I have an entityform with a field call "IP" (field_ip is its machine name). Now I need to set a value before that the entityform is saved. I have thinked to use hook_entity_presave() in this way:

function mymodule_entity_presave($entity, $type) {
      if ($type == 'entityform') {
        if ($entity-&gt;is_new === true || 1==1) {
          $entity-&gt;field_ip = array('LANGUAGE_NONE' =&gt; array(0 =&gt; array('value' =&gt; $_SERVER["REMOTE_ADDR"],'format' =&gt; '','safe_value' =&gt; $_SERVER["REMOTE_ADDR"])));
          $entity-&gt;original-&gt;field_ip = $entity-&gt;field_ip;   //Try this, too.
        };
      }
    }


(1==1 is only for test/debug). 

Via "devel" module I can see that the new value of field_ip is correctly set, but when I see the new version of the entityform entry (after the save action) I see the default value of that field and not my new value.
And infact if I re-edit the same entyform (id) I see the old value and not the new one. Where is my error ?
OK I now see what the problem is. LANGUAGE_NONE should not have quotes around it. It's a constant. Been there, done that. :)