diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/FieldTranslationSynchronizer.php b/core/modules/translation_entity/lib/Drupal/translation_entity/FieldTranslationSynchronizer.php index 6d84d99..9ab78d7 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/FieldTranslationSynchronizer.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/FieldTranslationSynchronizer.php @@ -67,7 +67,7 @@ public function synchronizeFields(EntityInterface $entity, $sync_langcode, $orig // Sync when the field is not empty, when the synchronization translations // setting is set, and the field is translatable. - if (!$entity->{$field_name}->isEmpty() && !empty($instance['settings']['translation_sync']) && field_is_translatable($entity_type, $field)) { + if (!$entity->get($field_name)->isEmpty() && !empty($instance['settings']['translation_sync']) && field_is_translatable($entity_type, $field)) { // Retrieve all the untranslatable column groups and merge them into // single list. $groups = array_keys(array_diff($instance['settings']['translation_sync'], array_filter($instance['settings']['translation_sync']))); @@ -88,7 +88,7 @@ public function synchronizeFields(EntityInterface $entity, $sync_langcode, $orig // used as the unchanged items. In fact there are no unchanged items // to check against. $langcode = $original_langcode ?: $sync_langcode; - $unchanged_items = $entity_unchanged->getTranslation($langcode)->{$field_name}->getValue(); + $unchanged_items = $entity_unchanged->getTranslation($langcode)->get($field_name)->getValue(); $this->synchronizeItems($values, $unchanged_items, $sync_langcode, array_keys($translations), $columns); foreach ($translations as $langcode => $language) {