Skip to content

Commit

Permalink
Merge pull request #423 from AcclaroInc/release/3.2.2
Browse files Browse the repository at this point in the history
Release/3.2.2
  • Loading branch information
bhupeshappfoster authored Feb 27, 2023
2 parents a9eda96 + 3e9b4c8 commit ce87a11
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
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

0 comments on commit ce87a11

Please sign in to comment.