diff --git a/src/Controller/AdminPages/CurrencyController.php b/src/Controller/AdminPages/CurrencyController.php index 0d6182e6..010200ca 100644 --- a/src/Controller/AdminPages/CurrencyController.php +++ b/src/Controller/AdminPages/CurrencyController.php @@ -39,6 +39,7 @@ use App\Services\LogSystem\TimeTravel; use App\Services\StructuralElementRecursionHelper; use Doctrine\ORM\EntityManagerInterface; use Exchanger\Exception\ChainException; +use Exchanger\Exception\Exception; use Exchanger\Exception\UnsupportedCurrencyPairException; use Omines\DataTablesBundle\DataTableFactory; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -117,8 +118,8 @@ class CurrencyController extends BaseAdminController try { $this->exchangeRateUpdater->update($entity); $this->addFlash('info', 'currency.edit.exchange_rate_updated.success'); - } catch (ChainException $exception) { - $exception = $exception->getExceptions()[0]; + } catch (Exception $exception) { + //$exception = $exception->getExceptions()[0]; if ($exception instanceof UnsupportedCurrencyPairException || false !== stripos($exception->getMessage(), 'supported')) { $this->addFlash('error', 'currency.edit.exchange_rate_update.unsupported_currency'); } else { diff --git a/templates/AdminPages/CurrencyAdmin.html.twig b/templates/AdminPages/CurrencyAdmin.html.twig index 45e02d4a..5cc28457 100644 --- a/templates/AdminPages/CurrencyAdmin.html.twig +++ b/templates/AdminPages/CurrencyAdmin.html.twig @@ -20,7 +20,7 @@ {{ form_row(form.exchange_rate) }} {% if form.update_exchange_rate is defined %} - {{ form_row(form.update_exchange_rate, {attr: {class: 'btn-link'}}) }} + {{ form_row(form.update_exchange_rate, {attr: {class: 'btn-info'}}) }} {% endif %} {% if entity.inverseExchangeRate %} diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf index d10f8379..e2b4299d 100644 --- a/translations/messages.en.xlf +++ b/translations/messages.en.xlf @@ -9923,5 +9923,23 @@ Element 3 IPN + + + currency.edit.update_rate + Retrieve exchange rate + + + + + currency.edit.exchange_rate_update.unsupported_currency + The currency is unsupported by the exchange rate provider. Check your exchange rate provider configuration. + + + + + currency.edit.exchange_rate_update.generic_error + Unable to retrieve the exchange rate. Check your exchange rate provider configuration. + +