diff --git a/modules/field/views_handler_field_field.inc b/modules/field/views_handler_field_field.inc index bc51d50..facfdb7 100644 --- a/modules/field/views_handler_field_field.inc +++ b/modules/field/views_handler_field_field.inc @@ -111,7 +111,7 @@ class views_handler_field_field extends views_handler_field { // Get the entity type according to the base table of the field. // Then add it to the query as a formula. That way we can avoid joining // the field table if all we need is entity_id and entity_type. - $this->entity_type = $entity_type = $this->definition['entity_tables'][$base_table]; + $entity_type = $this->definition['entity_tables'][$base_table]; // The alias needs to be unique, so we use both the field table and the entity type. $entity_type_alias = $this->definition['table'] . '_' . $entity_type . '_entity_type'; $this->aliases['entity_type'] = $this->query->add_field(NULL, "'$entity_type'", $entity_type_alias); @@ -545,11 +545,10 @@ class views_handler_field_field extends views_handler_field { return array(); } - $langcode = $this->field_language(); - // Go ahead and render and store in $this->items. $entity = clone $values->_field_data[$this->field_alias]['entity']; $entity_type = $values->_field_data[$this->field_alias]['entity_type']; + $langcode = $this->field_language($entity_type); // The field we are trying to display doesn't exist on this entity. if (!isset($entity->{$this->definition['field_name']})) { @@ -632,10 +631,10 @@ class views_handler_field_field extends views_handler_field { * Return the language code of the language the field should be displayed in, * according to the settings. */ - function field_language() { + function field_language($entity_type) { global $language_content; - if (field_is_translatable($this->entity_type, $this->field_info)) { + if (field_is_translatable($entity_type, $this->field_info)) { $default_language = language_default('language'); $language = str_replace(array('***CURRENT_LANGUAGE***', '***DEFAULT_LANGUAGE***'), array($language_content->language, $default_language),