diff --git a/title.module b/title.module index ee53c42..04c9280 100644 --- a/title.module +++ b/title.module @@ -150,8 +150,11 @@ function title_entity_presave($entity, $entity_type) { // need to synchronize the legacy field values into the replacing field // translations in the active language. if (module_invoke('entity_translation', 'enabled', $entity_type)) { - $langcode = title_active_language(); - $translations = entity_translation_get_handler($entity_type, $entity)->getTranslations(); + $translation_handler = entity_translation_get_handler($entity_type, $entity); + $translations = $translation_handler->getTranslations(); + if ($translation_handler->isEntityForm()) { + $langcode = $translation_handler->getFormLanguage(); + } // If we are removing a translation for the active language we need to skip // reverse synchronization, as we would store empty values in the original // replacing fields immediately afterwards. @@ -567,7 +570,9 @@ function title_active_language($langcode = NULL) { function title_entity_language($entity_type, $entity) { if (module_exists('entity_translation') && entity_translation_enabled($entity_type)) { $handler = entity_translation_get_handler($entity_type, $entity, TRUE); - $langcode = $handler->getLanguage(); + if ($handler->isEntityForm()) { + $langcode = $handler->getLanguage(); + } } else { $langcode = entity_language($entity_type, $entity);