diff --git a/auto_entitylabel.module b/auto_entitylabel.module index 01f11c1..ace2f58 100644 --- a/auto_entitylabel.module +++ b/auto_entitylabel.module @@ -239,6 +239,15 @@ function auto_entitylabel_set_title(&$entity, $type) { foreach ($title_languages as $language) { $titles[$language] = _auto_entitylabel_patternprocessor($pattern, $entity, $type, $language); } + + //Clear entity static caches, which now have been corrupted with translated versions of entities from above. + $entiy_info = entity_get_info(); + $entity_types = array_keys($entiy_info); + foreach ($entity_types as $entity_type) { + $entity_controller = entity_get_controller($entity_type); + $entity_controller->resetCache(); + } + } else { $titles[LANGUAGE_NONE] = _auto_entitylabel_patternprocessor($pattern, $entity, $type);