function layout_builder_entity_translation_create in Drupal 9
Same name and namespace in other branches
- 8 core/modules/layout_builder/layout_builder.module \layout_builder_entity_translation_create()
Implements hook_entity_translation_create().
File
- core/
modules/ layout_builder/ layout_builder.module, line 366 - Provides hook implementations for Layout Builder.
Code
function layout_builder_entity_translation_create(EntityInterface $translation) {
/** @var \Drupal\Core\Entity\FieldableEntityInterface $translation */
if ($translation
->hasField(OverridesSectionStorage::FIELD_NAME) && $translation
->getFieldDefinition(OverridesSectionStorage::FIELD_NAME)
->isTranslatable()) {
// When creating a new translation do not copy untranslated sections because
// per-language layouts are not supported.
$translation
->set(OverridesSectionStorage::FIELD_NAME, []);
}
}