I try to programmatically modify the body of a node using an entity wrapper.
In my Drupal installation I also use Locale module (language for node is 'en', for body it is 'und') and Revisioning module.
Now, I've created a simple code to do this task:
<?php // in database: field_data_body->body_value = 'old_value' $node = node_load(1); $wrapper = entity_metadata_wrapper('node', $node); print_r($wrapper->body->value->value()); // prints 'old_value' $wrapper->body->value = 'new_value'; print_r($wrapper->body->value->value()); // still prints 'old_value' $wrapper->save(); node_save($node); ?>
yet it seems not to make any changes to the node.
Although, if I've tried to change the title:
$wrapper->title = 'ABC';
everyting worked fine.
I guess it's the problem related to using localization, but I can't find sufficient documentation on how to achieve what I want.
Could someone tell me how can I put it to work?