Skip to content

Commit

Permalink
Merge pull request #473 from AcclaroInc/release/2.2.7
Browse files Browse the repository at this point in the history
Release/2.2.7
  • Loading branch information
bhupeshappfoster authored Sep 20, 2023
2 parents 537a927 + 224afa9 commit d158860
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 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.2.6",
"pluginVersion": "2.2.7",
"pluginAuthorName": "Acclaro",
"pluginVendorName": "Acclaro",
"pluginAuthorUrl": "http://www.acclaro.com/",
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ 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.2.7 - 2023-09-20

### Fixed
- Fixed an issue where an error is shown while loading plugin dashbaord when craft's update api is down.

## 2.2.6 - 2023-09-04

### Updated
Expand Down
20 changes: 12 additions & 8 deletions src/controllers/WidgetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,21 @@ public function actionIndex()
public function checkForUpdate($pluginHandle): bool
{
$hasUpdate = false;

$updateData = Craft::$app->getApi()->getUpdates([]);

$updates = new UpdatesModel($updateData);

foreach ($updates->plugins as $key => $pluginUpdate) {
if ($key === $pluginHandle && $pluginUpdate->getHasReleases()) {
$hasUpdate = true;

try {
$updateData = Craft::$app->getApi()->getUpdates([]);
$updates = new UpdatesModel($updateData);

foreach ($updates->plugins as $key => $pluginUpdate) {
if ($key === $pluginHandle && $pluginUpdate->getHasReleases()) {
$hasUpdate = true;
}
}
} catch (\Exception $e) {
Translations::$plugin->logHelper->log($e->getMessage(), Constants::LOG_LEVEL_ERROR);
}


return $hasUpdate;
}

Expand Down

0 comments on commit d158860

Please sign in to comment.