I get the following notice and warning when saving a translation the first time with entity translation field translation on a body field:

Notice: Undefined index: fr in mee_field_widget_form_alter() (line 299 of sites/all/modules/contrib/scald/modules/fields/mee/mee.module).
Warning: Invalid argument supplied for foreach() in mee_field_widget_form_alter() (line 307 of sites/all/modules/contrib/scald/modules/fields/mee/mee.module).

Comments

nagy.balint’s picture

The issue is caused by the fact that widget_form_alter is called for all values of the field (so all filled languages) even if we only submitted the english language at this time for example. But that will result in an error as the input will only have the english values then, but mee will try with all the other languages as well and fail.

nagy.balint’s picture

Here is a patch that introduces an isset check, however im not sure if this works in all situations, for me it seems to be fine.

nagy.balint’s picture

Status: Active » Needs review
jcisio’s picture

Status: Needs review » Needs work

I think we could just modify this line to add the langcode:
if (isset($form_state['input'][$context['field']['field_name']])) {
It was enough when the field had only one language, but it is no longer now when there is Entity Translation.

I don't have a set up right now, could you test it?

nagy.balint’s picture

Status: Needs work » Needs review
StatusFileSize
new783 bytes

You are right, as if the original isset is false then this will be false as well, and if the original isset is true then this is equivalent to my previous patch.

Attached the simpler patch. Seems to work as well.

  • Commit 571643c on 7.x-1.x by jcisio:
    Issue #2257949 by nagy.balint: Entity translation - using mee with field...
jcisio’s picture

Status: Needs review » Fixed

I haven't tested, but this patch could never fail! So, committed. Thanks!

Status: Fixed » Closed (fixed)

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