Skip to content

Commit b772197

Browse files
committed
MAGETWO-97247: Impossible to enable shared catalog through cli command
1 parent fd06972 commit b772197

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

app/code/Magento/Config/Model/Config/Backend/Currency/AbstractCurrency.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
namespace Magento\Config\Model\Config\Backend\Currency;
1515

1616
/**
17+
* Base currency class
18+
*
1719
* @api
1820
* @since 100.0.2
1921
*/
@@ -26,18 +28,19 @@ abstract class AbstractCurrency extends \Magento\Framework\App\Config\Value
2628
*/
2729
protected function _getAllowedCurrencies()
2830
{
29-
if (!$this->isFormData() || $this->getData('groups/options/fields/allow/inherit')) {
30-
return explode(
31+
$allowValue = $this->getData('groups/options/fields/allow/value');
32+
$allowedCurrencies = $allowValue === null || $this->getData('groups/options/fields/allow/inherit')
33+
? explode(
3134
',',
3235
(string)$this->_config->getValue(
3336
\Magento\Directory\Model\Currency::XML_PATH_CURRENCY_ALLOW,
3437
$this->getScope(),
3538
$this->getScopeId()
3639
)
37-
);
38-
}
40+
)
41+
: (array) $allowValue;
3942

40-
return (array)$this->getData('groups/options/fields/allow/value');
43+
return $allowedCurrencies;
4144
}
4245

4346
/**

dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigSetCommandTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* Tests the different flows of config:set command.
3030
*
31-
* {@inheritdoc}
31+
* @inheritdoc
3232
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3333
* @magentoDbIsolation enabled
3434
*/
@@ -292,8 +292,7 @@ public function runExtendedDataProvider()
292292
* @param string $scope
293293
* @param $scopeCode string|null
294294
* @dataProvider configSetValidationErrorDataProvider
295-
*
296-
* @magentoDbIsolation enabled
295+
* @magentoDbIsolation disabled
297296
*/
298297
public function testConfigSetValidationError(
299298
$path,
@@ -307,6 +306,7 @@ public function testConfigSetValidationError(
307306

308307
/**
309308
* Data provider for testConfigSetValidationError
309+
*
310310
* @return array
311311
*/
312312
public function configSetValidationErrorDataProvider()
@@ -399,7 +399,6 @@ public function testConfigSetCurrency()
399399
* Saving values with successful validation
400400
*
401401
* @dataProvider configSetValidDataProvider
402-
*
403402
* @magentoDbIsolation enabled
404403
*/
405404
public function testConfigSetValid()

0 commit comments

Comments
 (0)