diff --git a/includes/common.inc b/includes/common.inc index 15d7b74..407470a 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -7768,7 +7768,7 @@ function entity_label($entity_type, $entity) { * The entity for which to get the language. * * @return - * The entity language, or NULL if not found. + * A valid language code or NULL if the entity has no language support. */ function entity_language($entity_type, $entity) { $info = entity_get_info($entity_type); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index e0ae876..429c3b0 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -2029,8 +2029,7 @@ function comment_form($form, &$form_state, $comment) { // Attach fields. $comment->node_type = 'comment_node_' . $node->type; - $langcode = entity_language('comment', $comment); - field_attach_form('comment', $comment, $form, $form_state, $langcode); + field_attach_form('comment', $comment, $form, $form_state); return $form; } diff --git a/modules/path/path.module b/modules/path/path.module index 3b4fbf7..1bb06f4 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -273,6 +273,8 @@ function path_taxonomy_term_insert($term) { if (!empty($path['alias'])) { // Ensure fields for programmatic executions. $path['source'] = 'taxonomy/term/' . $term->tid; + // Core does not provide a way to store the term language but contrib + // modules can do it so we need to take this into account. $langcode = entity_language('taxonomy_term', $term); $path['language'] = !empty($langcode) ? $langcode : LANGUAGE_NONE; path_save($path); @@ -295,6 +297,8 @@ function path_taxonomy_term_update($term) { if (!empty($path['alias'])) { // Ensure fields for programmatic executions. $path['source'] = 'taxonomy/term/' . $term->tid; + // Core does not provide a way to store the term language but contrib + // modules can do it so we need to take this into account. $langcode = entity_language('taxonomy_term', $term); $path['language'] = !empty($langcode) ? $langcode : LANGUAGE_NONE; path_save($path); diff --git a/modules/user/user.module b/modules/user/user.module index cf98136..77420f5 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -161,6 +161,9 @@ function user_entity_info() { 'fieldable' => TRUE, 'entity keys' => array( 'id' => 'uid', + // $user->language is only the preferred user language for the user + // interface textual elements. As it is not necessarily related to the + // language fields have we do not define it as the entity langauge key. ), 'bundles' => array( 'user' => array(