First I thought this problem bit me:

http://drupal.org/node/1627740

but it turned out not to be.

I'm using the message module, I defined a bundle for it and defined fields for it. One of these fields is a "Link" field called "message_my_link".

This is how I save a new message:

$message = message_create('my_message_type', array(
  'arguments' => array(
    '%my_title'  => $my_title,
    ),
  ), $user);
$wrapper = entity_metadata_wrapper('message', $message);
$my_link = array(
    'url'        => "node/" . $node_id,
    'title'      => "My Node",
    'attributes' => array(),
  );
$wrapper->message_my_link->set($my_link);

When the message is saved I'm getting the warning:

"Warning: Illegal string offset 'translatable' in field_is_translatable() (line 179 of /var/www/drupal7/htdocs/modules/field/field.multilingual.inc)."

I debugged it a little and found out that in "EntityDrupalWrapper::setProperty" the "setter callback" that is retrieved by "EntityDrupalWrapper::getPropertyInfo" is "entity_metadata_field_verbatim_set" and this function leads to the "field_is_translatable" function being called with the arguments $entity_type = 'message and $field = 'message'.
Because $field is just a string, calling $field['translatable'] fails with a warning.

I'm not sure whether I made a mistake by setting the link or whether this is a bug. Hence I'm asking for your support.

Comments

matthias_mo’s picture

Has anyone read this or can anyone help me on this, I still have this problem?

matthias_mo’s picture

Status: Active » Closed (duplicate)

This is a duplicate of this issue.