From 88fa4495cc7471e2d2ce6fb16e8f25948baf953e Mon Sep 17 00:00:00 2001 From: Sumit Sharma Date: Thu, 11 Nov 2021 17:33:24 +0530 Subject: [PATCH 1/6] fix: Array to string conversion error when importing zip file --- src/services/job/ImportFiles.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/services/job/ImportFiles.php b/src/services/job/ImportFiles.php index 532c6b09..f4cab684 100644 --- a/src/services/job/ImportFiles.php +++ b/src/services/job/ImportFiles.php @@ -95,13 +95,19 @@ public function processFile( Asset $asset, $order = null , $fileFormat = null, $ } else if ($this->fileFormat === Constants::FILE_FORMAT_XML) { return $this->processXmlFile($asset, $file_content); } else { - $this->order->logActivity(Translations::$plugin->translator->translate('app', "File {($this->fileNames[$asset->id] ?? $asset->getFilename())} is invalid, please try again with a valid zip/xml/json/csv file.")); + $this->order->logActivity(sprintf( + "File {%s} is invalid, please try again with a valid zip/xml/json/csv file.", + $this->fileNames[$asset->id] ?? $asset->getFilename() + )); Translations::$plugin->orderRepository->saveOrder($this->order); return false; } } else { //Invalid - $this->order->logActivity(Translations::$plugin->translator->translate('app', "File {($this->fileNames[$asset->id] ?? $asset->getFilename())} is invalid, please try again with a valid zip/xml/json/csv file.")); + $this->order->logActivity(sprintf( + "File {%s} is invalid, please try again with a valid zip/xml/json/csv file.", + $this->fileNames[$asset->id] ?? $asset->getFilename() + )); Translations::$plugin->orderRepository->saveOrder($this->order); return false; } From 7a88c6daf2b87e0f00fcba679dd506dd40dc410a Mon Sep 17 00:00:00 2001 From: Sumit Sharma Date: Thu, 11 Nov 2021 17:40:35 +0530 Subject: [PATCH 2/6] fix: Order details template error --- src/controllers/OrderController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/OrderController.php b/src/controllers/OrderController.php index 7b59b829..b8f1c9da 100644 --- a/src/controllers/OrderController.php +++ b/src/controllers/OrderController.php @@ -349,8 +349,8 @@ public function actionOrderDetail(array $variables = array()) $variables['translatedFiles'][$file->id] = $tempElement->title; } - if ($translatedElement && $element instanceof Entry) { - $previewUrl = Translations::$plugin->urlGenerator->generateFileWebUrl($translatedElement, $file); + if ($element instanceof Entry) { + $previewUrl = Translations::$plugin->urlGenerator->generateFileWebUrl($translatedElement ?: $tempElement, $file); if ($file->status === Constants::FILE_STATUS_PUBLISHED) { $variables['webUrls'][$file->id] = $previewUrl; From 21f9215a36c98b00d82fb5a4a651616170b07313 Mon Sep 17 00:00:00 2001 From: Sid Edwards Date: Thu, 11 Nov 2021 18:33:20 -0700 Subject: [PATCH 3/6] docs: bumped plugin version --- .craftplugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.craftplugin b/.craftplugin index 9c0e0f56..f4c73486 100644 --- a/.craftplugin +++ b/.craftplugin @@ -1,7 +1,7 @@ { "pluginName": "Translations for Craft", "pluginDescription": "Drive global growth with simplified translation workflows.", - "pluginVersion": "2.0.3", + "pluginVersion": "2.0.4", "pluginAuthorName": "Acclaro", "pluginVendorName": "Acclaro", "pluginAuthorUrl": "http://www.acclaro.com/", From a84963003f9bec016441ec27c95e18ee966d5e44 Mon Sep 17 00:00:00 2001 From: Sid Edwards Date: Thu, 11 Nov 2021 18:33:38 -0700 Subject: [PATCH 4/6] docs: updated changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd947522..419c6322 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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/). +## Unreleased + +### Fixed +- 'Array to String Conversion' error (https://github.com/AcclaroInc/craft-translations/issues/255) +- 'Variable `webUrls` doesn't exist' error (https://github.com/AcclaroInc/craft-translations/issues/256) + ## 2.0.3 - 2021-10-28 ### Fixed From 4105528f5bd8620ea88be8fa4ada9f0fc305cdf9 Mon Sep 17 00:00:00 2001 From: Sid Edwards Date: Thu, 11 Nov 2021 18:34:35 -0700 Subject: [PATCH 5/6] chore: added plugin schemaVersion as constant --- src/Constants.php | 1 + src/Translations.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Constants.php b/src/Constants.php index a30b1405..1d75466a 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -4,6 +4,7 @@ class Constants { + const PLUGIN_SCHEMA_VERSION = '1.3.6'; const CRAFT_MIN_VERSION = '3.7.9'; const WORD_COUNT_LIMIT = 2000; diff --git a/src/Translations.php b/src/Translations.php index 6198abfd..cd1829fd 100644 --- a/src/Translations.php +++ b/src/Translations.php @@ -29,6 +29,7 @@ use craft\events\RegisterUrlRulesEvent; use craft\events\RegisterComponentTypesEvent; use craft\events\DeleteElementEvent; +use acclaro\translations\Constants; use acclaro\translations\services\App; use acclaro\translations\elements\Order; use acclaro\translations\base\PluginTrait; @@ -73,7 +74,7 @@ class Translations extends Plugin /** * @var string */ - public $schemaVersion = '1.3.6'; + public $schemaVersion = Constants::PLUGIN_SCHEMA_VERSION; // Public Methods // ========================================================================= From 6c70e6ba40b9ff215885882c55b364c43d70bac7 Mon Sep 17 00:00:00 2001 From: Sid Edwards Date: Fri, 12 Nov 2021 15:17:55 -0700 Subject: [PATCH 6/6] docs(v2.0.4): updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 419c6322..edfeb2d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 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/). -## Unreleased +## 2.0.4 - 2021-11-12 ### Fixed - 'Array to String Conversion' error (https://github.com/AcclaroInc/craft-translations/issues/255)