From 9c4585bbdf095ef6a0e2509c0ba5bacb200b9a5b Mon Sep 17 00:00:00 2001 From: Maciej Kobus Date: Wed, 16 Aug 2023 16:36:55 +0200 Subject: [PATCH] Added fallback for cases when base value is not set for nontranslatable fields in ContentUpdateMapper (#73) --- src/lib/Data/Mapper/ContentUpdateMapper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Data/Mapper/ContentUpdateMapper.php b/src/lib/Data/Mapper/ContentUpdateMapper.php index 10f0f8f..3367f00 100644 --- a/src/lib/Data/Mapper/ContentUpdateMapper.php +++ b/src/lib/Data/Mapper/ContentUpdateMapper.php @@ -45,7 +45,7 @@ public function mapToFormData(ValueObject $contentDraft, array $params = []) $data->addFieldData(new FieldData([ 'fieldDefinition' => $fieldDef, 'field' => $field, - 'value' => $isNonTranslatable + 'value' => $isNonTranslatable && isset($mappedCurrentFields[$fieldDef->identifier]) ? $mappedCurrentFields[$fieldDef->identifier]->value : $field->value, ]));