Skip to content

Commit

Permalink
Merge pull request #314 from AcclaroInc/release/2.1.4
Browse files Browse the repository at this point in the history
Release/2.1.4
  • Loading branch information
shnsumit authored Mar 14, 2022
2 parents 263cb72 + b2ec01a commit 536601c
Show file tree
Hide file tree
Showing 6 changed files with 31 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": "2.1.3",
"pluginVersion": "2.1.4",
"pluginAuthorName": "Acclaro",
"pluginVendorName": "Acclaro",
"pluginAuthorUrl": "http://www.acclaro.com/",
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 1 addition & 3 deletions src/Translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
19 changes: 19 additions & 0 deletions src/services/repository/FileRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 536601c

Please sign in to comment.