I'm using entity_metadata_wrapper to programatically create some nodes. I noticed that some of the fields weren't showing in the node/edit form after doing this, even though they are shown on the frontend. After lots of digging I found in the database that the field data is being saved with 'und' instead of my chosen language ('en'). What is the way to fix this?
The field 'introduction' is definitely translatable before anyone asks (otherwise it would show in the backend just fine).
$entity = entity_create('node', array( 'type' => 'my_bundle', 'uid' => $user->uid, 'status' => 1, 'comment' => 0, 'promote' => 0, 'language' => 'en' )); $ewrapper = entity_metadata_wrapper('node', $entity); $ewrapper->language('en'); // Thought this would do it, but no dice $ewrapper->title->set('This works fine'); $ewrapper->field_introduction->set('This doesnt'); $ewrapper->save();