Change record status: 
Project: 
Introduced in branch: 
7.x
Introduced in version: 
7.22
Description: 

Before Drupal 7.22, the Locale module did not handle comment field languages. As a consequence, field language was not correctly stored for translatable comment fields. In fact, since field widgets always have LANGUAGE_NONE as their initial value on new comments, submitting translatable fields led to a bunch of errors when the comment was saved, because the comment language was altered by the Locale module after field_attach_form() was called.

Additionally the language actually stored for translatable fields was the default site language no matter which language the comment had, which is not the intended behavior. Now, comment field language and comment language are always the same.

Before Drupal 7.22:

<?php
  // The site default language is 'it', the current page language is 'en'.
  // After submitting the comment we have:
  $comment->language == 'en'; // TRUE
  isset($comment->comment_body['it']); // TRUE
  isset($comment->comment_body['en']); // FALSE
?>

After Drupal 7.22:

<?php
  // The site default language is 'it', the current page language is 'en'.
  // After submitting the comment we have:
  $comment->language == 'en'; // TRUE
  isset($comment->comment_body['en']); // TRUE
  isset($comment->comment_body['it']); // FALSE
?>

This behavior was worked around in contrib by Entity Translation, which now will be updated to match the core change. Here is the relevant issue: #1760270: Comment translation broken?.

Additionally translatable comment fields now benefit from language fallback behavior: previously when displaying a comment with a page language not matching the field one, every translatable field disappeared. Now they will appear correctly.

As a result of the comment-related changes, the Locale module now also has a new API function called locale_field_entity_form_submit() that can be use to manage field language submissions for translatable fields in a generic fashion.

Impacts: 
Site builders, administrators, editors
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done