diff --git a/core/modules/config_translation/src/ConfigFieldMapper.php b/core/modules/config_translation/src/ConfigFieldMapper.php index 367a999..2b00d34 100644 --- a/core/modules/config_translation/src/ConfigFieldMapper.php +++ b/core/modules/config_translation/src/ConfigFieldMapper.php @@ -55,14 +55,17 @@ public function getTypeLabel() { * {@inheritdoc} */ public function setEntity(EntityInterface $entity) { - parent::setEntity($entity); + if (parent::setEntity($entity)) { - // Field storage config can also contain translatable values. Add the name - // of the config as well to the list of configs for this entity. - $field_storage = $entity->getFieldStorageDefinition(); - $entity_type_info = $this->entityManager->getDefinition($field_storage->getEntityTypeId()); - $this->addConfigName($entity_type_info->getConfigPrefix() . '.' . $field_storage->id()); - return TRUE; + // Field storage config can also contain translatable values. Add the name + // of the config as well to the list of configs for this entity. + /** @var \Drupal\field\FieldStorageConfigInterface $field_storage */ + $field_storage = $this->entity->getFieldStorageDefinition(); + $entity_type_info = $this->entityManager->getDefinition($field_storage->getEntityTypeId()); + $this->addConfigName($entity_type_info->getConfigPrefix() . '.' . $field_storage->id()); + return TRUE; + } + return FALSE; } }