By gábor hojtsy on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.6.x
Introduced in version:
8.6.0-alpha1
Issue links:
Description:
New hooks are added that allow to control a new revision created by \Drupal\Core\Entity\ContentEntityStorageBase::createRevision().
This can be used to change the new revision generated by that method and for example allows to consider the value of an untranslatable field in the original draft revision.
function hook_entity_revision_create(Drupal\Core\Entity\EntityInterface $new_revision, Drupal\Core\Entity\EntityInterface $entity, $keep_untranslatable_fields) {
// Retain the value from an untranslatable field, which are by default
// synchronized from the default revision.
$new_revision->set('untranslatable_field', $entity->get('untranslatable_field'));
}
Further work is going in at the sub-issues of #2960253: [meta] Allow Paragraphs widget/field and similar use cases to to be considered translatable.
Impacts:
Module developers