Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/3.2.2 #423

Merged
merged 5 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .craftplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"pluginName": "Translations for Craft",
"pluginDescription": "Drive global growth with simplified translation workflows.",
"pluginVersion": "3.2.1",
"pluginVersion": "3.2.2",
"pluginAuthorName": "Acclaro",
"pluginVendorName": "Acclaro",
"pluginAuthorUrl": "http://www.acclaro.com/",
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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/).

## 3.2.2 - 2023-02-27

### Fixed
- An issue where delivered files failed to merge into draft ([AcclaroInc#421](https://github.com/AcclaroInc/craft-translations/issues/421))
- An issue where log files failed to download with invalid date error.

## 3.2.1 - 2023-02-06

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function actionDownloadLogs()
return $this->asFailure($this->getErrorMessage("Something went wrong with date"));
}

$requestedDate = \DateTime::createFromFormat('n/j/Y', $requestedDate)->format('Y-m-d');
$requestedDate = \DateTime::createFromFormat('d/m/Y', $requestedDate)->format('Y-m-d');
$errors = \DateTime::getLastErrors();

if (($errors['warning_count'] + $errors['error_count']) > 0) {
Expand Down
7 changes: 2 additions & 5 deletions src/services/fieldtranslator/NeoFieldTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function parseBlockData(&$allBlockData, $blockData, $blockId=null)
$newToParse = array();

foreach ($blockData as $key => $value) {
if (is_numeric($key) || strpos($key, "_") !== false || strpos($key, "new", 0) !== false) {
if (is_numeric($key) || strpos($key, "new", 0) !== false) {
$newToParse[$key] = $value;
} else {
$newBlockData[$key] = $value;
Expand Down Expand Up @@ -101,11 +101,8 @@ public function toPostArrayFromTranslationTarget(ElementTranslator $elementTrans
foreach ($blocks as $i => $block) {
$i = 'new' . ++$new;

// Check for old key in case an order was created before plugin update
$oldKey = sprintf('%s_%s', $block->fieldId, $block->canonicalId);

$blockId = $field->getIsTranslatable() ? $i : $block->id;
$blockData = $allBlockData[$i] ?? $allBlockData[$oldKey] ?? array();
$blockData = $allBlockData[$i] ?? array();

$post[$fieldHandle][$blockId] = array(
'modified' => '1',
Expand Down