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/3.0.1 #389

Merged
merged 7 commits into from
Sep 6, 2022
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