From 97b27a8288b195d4db3ab42bee380063967bdae3 Mon Sep 17 00:00:00 2001 From: Sumit Sharma Date: Sat, 26 Feb 2022 01:55:00 +0530 Subject: [PATCH 1/4] fix: plugin uninstall deleting entries --- src/Translations.php | 4 +--- src/services/repository/FileRepository.php | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/Translations.php b/src/Translations.php index 18522322..d9bb9b19 100644 --- a/src/Translations.php +++ b/src/Translations.php @@ -206,9 +206,7 @@ function (PluginEvent $event) { public function uninstall() { // Let's clean up the drafts table - $files = self::$plugin->fileRepository->getFiles(); - $drafts = array_column($files, 'draftId'); - + $drafts = self::$plugin->fileRepository->getAllDraftIds(); if ($drafts) { Craft::$app->queue->push(new DeleteDrafts([ 'description' => Constants::JOB_DELETING_DRAFT, diff --git a/src/services/repository/FileRepository.php b/src/services/repository/FileRepository.php index eabf694b..fa61d3fd 100644 --- a/src/services/repository/FileRepository.php +++ b/src/services/repository/FileRepository.php @@ -103,6 +103,25 @@ public function getFiles($orderId = null, $elementId = null, $targetSite = null) return $files ? $files : array(); } + /** + * @return array + */ + public function getAllDraftIds() + { + + $records = FileRecord::find()->where(['IS NOT', 'draftId', NULL])->all(); + + $draftIds = []; + + foreach ($records as $key => $record) { + if(!empty($record->draftId)){ + $draftIds[] = $record->draftId; + } + } + + return $draftIds; + } + /** * @return \acclaro\translations\models\FileModel */ From 988d9a196d46cf704a529e867295a80da49854ac Mon Sep 17 00:00:00 2001 From: bhupeshappfoster Date: Mon, 7 Mar 2022 21:00:42 +0530 Subject: [PATCH 2/4] task: added new token and url for iso mapping --- src/Constants.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Constants.php b/src/Constants.php index 5a4c01d8..cfea4c78 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -165,8 +165,8 @@ class Constants ]; // Craft Graphql data - const GRAPHQL_API_BASE_URI = 'https://acclarocraft3.com/api'; - const GRAPHQL_ISO_MAPPING_TOKEN = 'G3LIVghEQhBwZEqDSaXYgTB6STSHDiqs'; + const GRAPHQL_API_BASE_URI = 'https://acclarocraft.com/api'; + const GRAPHQL_ISO_MAPPING_TOKEN = '6LBN7WdtRFHLAAgVv4G8LA3ifp63SgXm'; const GRAPHQL_ISO_MAPPING_QUERY = 'query MyQuery { entry(slug: "translations-plugin-iso-mapping") { dateUpdated @formatDateTime (format: "Y-m-d H:m:s") From 347a5bfe83350c5c116bfac7f71d98a811dfd745 Mon Sep 17 00:00:00 2001 From: Sumit Sharma Date: Tue, 15 Mar 2022 01:57:15 +0530 Subject: [PATCH 3/4] Updated composer to required latest version with security fix. --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 83b65c9c..fc6fc266 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,7 @@ "php": ">=7.2.0", "sebastian/diff": "^3.0", "composer/composer": "^2.1.9", + "enshrined/svg-sanitize": "~0.14.0|~0.15.2", "spatie/guzzle-rate-limiter-middleware": "^2.0" }, "autoload": { From b2ec01a93eb5d211ab100bda60e0cc2efd7b794c Mon Sep 17 00:00:00 2001 From: Sumit Sharma Date: Tue, 15 Mar 2022 02:16:02 +0530 Subject: [PATCH 4/4] bump version and update changelog --- .craftplugin | 2 +- CHANGELOG.md | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.craftplugin b/.craftplugin index 3c4ac603..ad4b93ef 100644 --- a/.craftplugin +++ b/.craftplugin @@ -1,7 +1,7 @@ { "pluginName": "Translations for Craft", "pluginDescription": "Drive global growth with simplified translation workflows.", - "pluginVersion": "2.1.3", + "pluginVersion": "2.1.4", "pluginAuthorName": "Acclaro", "pluginVendorName": "Acclaro", "pluginAuthorUrl": "http://www.acclaro.com/", diff --git a/CHANGELOG.md b/CHANGELOG.md index 6173515b..5eaa2b61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,13 @@ 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.1.4 - 2022-03-14 + +### Updated +- ISO alias mapping API endpoint (https://github.com/AcclaroInc/craft-translations/pull/315) + +### Fixed +- Plugin uninstallation bug (https://github.com/AcclaroInc/craft-translations/pull/313) ## 2.1.3 - 2022-02-21