Closed
Description
Preconditions
- Magento ver. 2.1.3
- Ubuntu 16.04
- PHP 7.0.8-0ubuntu0.16.04.3 ( NTS )
- MySQL Ver 15.1 Distrib 10.0.28-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Steps to reproduce
- In admin navigate to configuration
- General -> Currency Setup
- Select a single value in the multiple selects
- Click on save
Expected result
- Currency values should update as per selection
Actual result
- Something went wrong while saving this configuration: Warning: in_array() expects parameter 2 to be array, string given in /var/www/clean-m2-ee/vendor/magento/module-config/Model/Config/Backend/Currency/DefaultCurrency.php on line 30
This is because the $this->_getAllowedCurrencies() method returns a string for single values and not an array as expected. Typecasting that to an array would fix this:
if (!in_array($this->getValue(), (array)$this->_getAllowedCurrencies())) {
Or alternatively update the methods to always return arrays.