only in patch2: unchanged: --- a/core/includes/entity.inc +++ b/core/includes/entity.inc @@ -555,7 +555,7 @@ function entity_get_form(EntityInterface $entity, $operation = 'default', array * so the builder function for such forms needs to implement the required * functionality instead of calling this function. */ -function entity_form_submit_build_entity($entity_type, $entity, $form, &$form_state) { +function entity_form_submit_build_entity($entity_type, $entity, $form, &$form_state, array $options = array()) { $info = entity_get_info($entity_type); // Copy top-level form values that are not for fields to entity properties, @@ -576,7 +576,7 @@ function entity_form_submit_build_entity($entity_type, $entity, $form, &$form_st // Copy field values to the entity. if ($info['fieldable']) { - field_attach_extract_form_values($entity, $form, $form_state); + field_attach_extract_form_values($entity, $form, $form_state, $options); } } only in patch2: unchanged: --- a/core/lib/Drupal/Core/Entity/EntityFormController.php +++ b/core/lib/Drupal/Core/Entity/EntityFormController.php @@ -484,7 +484,7 @@ public function buildEntity(array $form, array &$form_state) { $form_state['controller'] = $this; // @todo Move entity_form_submit_build_entity() here. // @todo Exploit the Field API to process the submitted entity field. - entity_form_submit_build_entity($entity->entityType(), $entity, $form, $form_state); + entity_form_submit_build_entity($entity->entityType(), $entity, $form, $form_state, array('langcode' => $this->getFormLangcode($form_state))); return $entity; } only in patch2: unchanged: --- a/core/lib/Drupal/Core/Entity/EntityFormControllerNG.php +++ b/core/lib/Drupal/Core/Entity/EntityFormControllerNG.php @@ -77,7 +77,7 @@ public function buildEntity(array $form, array &$form_state) { // Invoke field API for copying field values. if ($info['fieldable']) { - field_attach_extract_form_values($entity, $form, $form_state); + field_attach_extract_form_values($entity, $form, $form_state, array('langcode' => $this->getFormLangcode($form_state))); } return $entity; }