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/2.0.4 #261

Merged
merged 8 commits into from
Nov 12, 2021
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": "2.0.3",
"pluginVersion": "2.0.4",
"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/).

## 2.0.4 - 2021-11-12

### 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
Expand Down
1 change: 1 addition & 0 deletions src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion src/Translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -73,7 +74,7 @@ class Translations extends Plugin
/**
* @var string
*/
public $schemaVersion = '1.3.6';
public $schemaVersion = Constants::PLUGIN_SCHEMA_VERSION;

// Public Methods
// =========================================================================
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 8 additions & 2 deletions src/services/job/ImportFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down