diff --git a/CHANGELOG.md b/CHANGELOG.md index 181f4d6b..c395fe01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 4.4.5 - 2024-02-09 +### Fixed +- Translation of nested link field + ## 4.4.4 - 2024-01-31 ### Changed - Change translations batch size diff --git a/composer.json b/composer.json index 32f47c14..8fa6fc3b 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "lilt/craft-lilt-plugin", "description": "The Lilt plugin makes it easy for you to send content to Lilt for translation right from within Craft CMS.", "type": "craft-plugin", - "version": "4.4.4", + "version": "4.4.5", "keywords": [ "craft", "cms", diff --git a/src/services/appliers/field/LenzLinkFieldContentApplier.php b/src/services/appliers/field/LenzLinkFieldContentApplier.php index 3d5aa1cf..440c7f7e 100644 --- a/src/services/appliers/field/LenzLinkFieldContentApplier.php +++ b/src/services/appliers/field/LenzLinkFieldContentApplier.php @@ -32,11 +32,20 @@ public function apply(ApplyContentCommand $command): ApplyContentResult $fieldValue = $command->getElement()->getFieldValue( $field->handle ); + $fieldValue->customText = $content[$fieldKey]; - $command->getElement()->setFieldValue($field->handle, $fieldValue); + $serialized = $field->serializeValue($fieldValue, $command->getElement()); + $command->getElement()->setFieldValues([$field->handle => $serialized]); + + $this->forceSave($command); - return ApplyContentResult::applied(); + return ApplyContentResult::applied( + [], + $command->getElement()->getFieldValue( + $command->getField()->handle + ) + ); } public function support(ApplyContentCommand $command): bool