When using ->set('something') with field translation enabled on this field, it gives me a warning :

Warning: Illegal string offset 'translatable' in field_is_translatable() (line 180 of /very_cool_project/modules/field/field.multilingual.inc).

After adding some backtrace, found out entity_metadata_field_verbatim_set calls entity_metadata_field_get_language with the wrong arguments:

$langcode = entity_metadata_field_get_language($entity_type, $entity, $entity_type, $langcode);

instead of

$langcode = entity_metadata_field_get_language($entity_type, $entity, $field, $langcode);

I'll attach a patch in the first comment, don't know what the issue ID will be...

#1 entity-fix_arguments-1829156-1.patch744 bytesPierre Paul Lefebvre
PASSED: [[SimpleTest]]: [MySQL] 374 pass(es).
[ View ]


Pierre Paul Lefebvre’s picture

new744 bytes
PASSED: [[SimpleTest]]: [MySQL] 374 pass(es).
[ View ]
kscheirer’s picture

The function header for entity_metadata_field_get_language() takes a $field in the 3rd argument, patch looks good to me.

kscheirer’s picture

Status:Needs review» Closed (duplicate)

After further searching through the queue, I think this issue is a duplicate of #1376126: Fix language handling for translatable fields.

mitchell’s picture

Title:Warning: Illegal string offset 'translatable' in field_is_translatable() » Incorrect parameter passing in entity_metadata_field_get_language()
Status:Closed (duplicate)» Reviewed & tested by the community

Altering approach in #3, so that #8-#28, in the mentioned issue, are duplicates of this issue.

#25 there (by kalabro) is the same as #1. #27 there confirms the fix, so marking #1 as RTBC.

matthias_mo’s picture

I've created this issue which has the same cause.

fago’s picture

Status:Reviewed & tested by the community» Fixed

Thanks, committed.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.