Essentially, there really isn't much difference between
node_save() and the
save() method of the entity metadata wrapper. Neither should however be used to save the node passed in as the argument to
The argument is passed by reference (since it's an object and all objects are passed by reference in later PHP versions), and any changes you make to it will be included when the node is saved by Drupal just after it's done calling the hook implementation.
Trying to manually save the same node again could trigger endless recursion into your
Just alter the node object as you see fit (setting the title in this case, though that is not a translatable string, so replace
check_plain()) and do nothing more.
If you need to do more complex alterations, the entity metadata wrapper could come in handy, but you must remember that any alterations you want to have saved must be performed on the node instance passed as a reference to
hook_node_insert(). This means you can't
node_load($node->nid) here first, since that would actually just create a new node object with data that's already in the database. If you do manage to save that node copy without ending up in a recursion loop, it would either mean that the node save already in progress - the reason
hook_node_insert() was originally called - overwrites any changes you made, or fails because the new node to be saved already exists.
Instead, pass the
$node argument to
entity_metadata_wrapper() directly and the wrapper will be able to alter the correct node object for you, but remember to not call
save() on the wrapper!