Two new entity hooks with their respective entity-type-specific flavors were added:
hook_entity_translation_create()
hook_entity_field_values_init()
Before this change when creating a new entity translation via the ::addTranslation()
method the hook_entity_create()
was invoked to allow to massage initial field values also for entity translations without duplicating code.
This logic should be now implemented via hook_entity_field_values_init()
, while hook_entity_create()
and hook_entity_translation_create()
should be used when needing to act on their specific cases.
Additionally a new method TranslatableInterface::isNewTranslation()
method was added to allow to tell whether an entity translation object has just been instantiated or was already persisted previously.