Skip to content

Commit

Permalink
Merge pull request #143 from lilt/4.x-fix-nested-field
Browse files Browse the repository at this point in the history
Fix translation of nested link field
  • Loading branch information
hadomskyi authored Feb 9, 2024
2 parents 3331cce + f9bd0b5 commit 5302daa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 11 additions & 2 deletions src/services/appliers/field/LenzLinkFieldContentApplier.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5302daa

Please sign in to comment.