I changed the option for "Currency amount formatting" to English (United Kingdom).
While trying to setup the exchange rates, the following error was logged:
---
RuntimeException: The currency locale for en_US could not be loaded. in Drupal\currency\LocaleResolver->resolveCurrencyLocale() (line 103 of /.../modules/currency/src/LocaleResolver.php).
---
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | currency-2807531-8.patch | 1.71 KB | berdir |
| #6 | 2807531-6.patch | 633 bytes | h3rj4n |
Comments
Comment #2
xanoThank you for reporting this problem! Can you please update the issue summary with detailed step-by-step instructions on how to reproduce the problem on a clean Drupal installation using only the absolutely necessary additional modules?
Comment #3
flk commentedVersion: drupal-8.3.4
PHP 7
Apache2
OS: Ubuntu 17.04
----
Installed module, added 2 (GBP and USD) currencies using the 'Import a currency'
then went to
1. /admin/config/regional/currency-exchange
2. admin/config/regional/currency-exchange/fixed (edit fixed rates)
entered the rate as 1.24 and saved and following error showed up: "The website encountered an unexpected error. Please try again later."
Upon looking at the error logs, i see the below and can no longer access the fixed rate edit screen(2):
Uncaught PHP Exception RuntimeException: "The currency locale for en_US could not be loaded." at /var/www/d8/drupal-8.3.4/modules/contrib/currency/src/LocaleResolver.php line 103, referer: http://d8.local/admin/config/regional/currency-exchangeComment #4
flk commentedComment #5
vaza18 commentedCheck that you have English (US) locale at "/admin/config/regional/currency-formatting/locale"
This may happen if you loose config file and reinstalled the site using config-import.
I had the same issue and it got's resolved when I added English (United States) locale manually.
Comment #6
h3rj4n commentedI ran into the same problem. I've my site set to Netherlands/Amsterdam. I don't want to install ore use the en_US locale. I think this is the problem:
Here the class LocaleResolver tries to access the config file
system.datawhich does not exists. I think it's a typo becausesystem.datedoes exist ;)I've added a patch to fix this.
Comment #7
berdirYeah, once more a problem with unit test faking the same bugs as the real code. \Drupal\Tests\currency\Unit\LocaleResolverTest needs to be updated, triggered a test which should fail now.
Comment #8
berdirComment #9
berdirCommitted.
Comment #11
berdir