Give the gift of Drupal. All merchandise is 50% off through 2016.
entity_metadata_field_get_language() the default language is determined using the following:
$default_langcode = isset($entity->language) ? $entity->language : LANGUAGE_NONE;
However, if no language is set for the entity,
$entity->language may be set to an empty string (
''). This causes
isset() to return
TRUE and ends up returning an empty string if
$langcode == LANGUAGE_NONE due to the following a few lines lower:
$langcode = ($langcode != LANGUAGE_NONE) ? field_valid_language($langcode, $default_langcode) : $default_langcode;
The line to determine the the default language should use
!empty() instead, this will cover situations where it is not set as well as situations where it is set to
NULL or an empty string.