Hello,
I'm not sure if this is an issue with message or enitycache or it's intended behavior.
I see that entitycache support was added here https://drupal.org/node/1863190

When I have entitycache enabled, I cannot save data to message fields using the entity_metadata_wrapper
The following code creates the message, but the node reference is not populated when I view it using message_ui nor do any node tokens work.

// in my modules hook_node_insert()
$message = message_create('my_message_type', array('arguments' => $arguments, 'uid' => $node->uid),
  $wrapper = entity_metadata_wrapper('message', $message);
  $wrapper->field_node_ref->set($node);
  $wrapper->field_published->set($node->status);
$wrapper->save();

when I disable entity cache, it works fine.
thanks.

Comments

loze’s picture

Title: Can't save message fields usining enitiy_metadata_wrapper with entitycache module enabled » Can't save message fields using enitiy_metadata_wrapper with entitycache module enabled
loze’s picture

Issue summary: View changes

typo

aether’s picture

Issue summary: View changes

I'm having a similar problem. With entitycache enabled, messages are displaying message type field data from the wrong nodes. Disabling entitycache corrects the issue.

alesr’s picture

Status: Active » Closed (cannot reproduce)

I explicitly checked both cases with Message module and Entity cache enabled and in both cases the Message entity was updated and showed the right fields from the right nodes/entities.

It might be an old issue that was resolved either in Message or Entity cache module but we steel need to update the status of it if it's not the case any more, therefore marking it as Closed (cannot reproduce).