public function synchronizeFields(ContentEntityInterface
$entity,
$sync_langcode,
$original_langcode = NULL
) { $translations =
$entity->
getTranslationLanguages();
// If we have no information about what to sync to, if we are creating a new
// entity, if we have no translations for the current entity and we are not
// creating one, then there is nothing to synchronize.
if (empty($sync_langcode) ||
$entity->
isNew() ||
count($translations) < 2
) { return;
} // If the entity language is being changed there is nothing to synchronize.
$entity_unchanged =
$this->
getOriginalEntity($entity);
if ($entity->
getUntranslated()->
language()->
getId() !=
$entity_unchanged->
getUntranslated()->
language()->
getId()) { return;
} if ($entity->
isNewRevision()) { if ($entity->
isDefaultTranslationAffectedOnly()) { // If changes to untranslatable fields are configured to affect only the
// default translation, we need to skip synchronization in pending
// revisions, otherwise multiple translations would be affected.
if (!
$entity->
isDefaultRevision()) { return;
}