Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Replace LANGUAGE_NONE with proper language code.
Replace LANGUAGE_NONE with proper language code.
Comments
Comment #1
radimklaskaI need to know entity type to get the right language using
field_language($entity_type, $entity, $field_name = NULL, $langcode = NULL)
I don't like passing around
$entity_type
, but core does that too :-/ and there is no way I can figure out$entity_type
on the spot.Comment #3
radimklaskaI've added
$entity->vfo_entity_type
onhook_entity_load
so we can use it infield_language()