While working on tests, we always got a Undefined index '#multilingual' notice on the Entity Translation UI tests.

Turns out that we have this code in EntityTranslationController.php:

      if ($language_widget) {
        $form_langcode['#multilingual'] = TRUE;
      }

That makes no sense at all because $form_langcode is string: "$form_langcode = $form_controller->getFormLangcode($form_state);".

I don't know what that #multilingual property exactly does, maybe it should just use $form? Also, whatever it *should* do is probably broken, so that needs tests :)

Comments

plach’s picture

Status: Active » Closed (duplicate)

It was meant to be $form['langcode']['#multilingual'] = TRUE;. It's just hiding the "all languages" hint, I don't think this deserves a test. See #1498724: Introduce a #multilingual key (or similar) for form element for details.

I'm marking this as a duplicate of #1831530: Entity translation UI in core (part 2). I'll fix it there along with the rest.