Skip to content

Commit

Permalink
Release/3.0.1 (#389)
Browse files Browse the repository at this point in the history
* fix: catch error when newsfeed is unreachable

* fix: #387

* update: log for graceful handling of acclaro feed failure

* update: change log and bump version

Co-authored-by: jdsdev <[email protected]>
  • Loading branch information
bhupeshappfoster and jdsdev authored Sep 6, 2022
1 parent aa9ca34 commit a948564
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 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": "3.0.0",
"pluginVersion": "3.0.1",
"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/).

## 3.0.1 - 2022-09-06

### Fixed
- Unhandled exception on plugin installation ([AcclaroInc#387](https://github.com/AcclaroInc/craft-translations/issues/387))
- Exception opening plugin dashboard when acclaro feed is unavailable.

## 3.0.0 - 2022-08-24

### Fixed
Expand Down
11 changes: 7 additions & 4 deletions src/Translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,13 @@ function (DeleteElementEvent $event) {
Plugins::class,
Plugins::EVENT_AFTER_INSTALL_PLUGIN,
function (PluginEvent $event) {
self::$plugin->logHelper->log(
'['. __METHOD__ .'] Plugins::EVENT_AFTER_INSTALL_PLUGIN',
Constants::LOG_LEVEL_INFO
);
if (self::getInstance()->settings->apiLogging) {
Craft::info(
'[' . __METHOD__ . '] Plugins::EVENT_AFTER_INSTALL_PLUGIN',
'translations'
);
}

if ($event->plugin === $this) {
$request = Craft::$app->getRequest();
if ($request->isCpRequest) {
Expand Down
10 changes: 9 additions & 1 deletion src/widgets/News.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

use Craft;
use craft\base\Widget;
use acclaro\translations\Constants;
use acclaro\translations\Translations;
use acclaro\translations\records\WidgetRecord;

/**
Expand Down Expand Up @@ -115,7 +117,13 @@ private function _getArticles(): array
'verify' => false
));

$response = $client->get('feed/');
try {
$response = $client->get('feed/');
} catch (\Exception $e) {
Translations::$plugin->logHelper->log("[" . __METHOD__ . "] . $e", Constants::LOG_LEVEL_ERROR);
return [];
}

$data = $response->getBody()->getContents();
$feed = simplexml_load_string($data);

Expand Down

0 comments on commit a948564

Please sign in to comment.