Skip to content

Commit a79a945

Browse files
committed
fixes [#3]
1 parent f62685f commit a79a945

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Model/Service/DumpCmsDataService.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,16 @@ private function write(WriteInterface $writeDirectory, string $filePath, string
8383
private function getStoreCodes($stores): array
8484
{
8585
$storeCodes = [];
86-
if ($stores) {
86+
if (!$stores) {
87+
return [self::STORE_SCOPE_ALL];
88+
} else {
8789
foreach ($stores as $storeId) {
90+
if ($storeId == 0) {
91+
return [self::STORE_SCOPE_ALL];
92+
}
8893
try {
8994
$store = $this->storeManager->getStore($storeId);
90-
$storeCode = $storeId ? $store->getCode() : self::STORE_SCOPE_ALL;
91-
$storeCodes[] = $storeCode;
95+
$storeCodes[] = $store->getCode();
9296
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
9397
echo $exception->getMessage() . "\n";
9498
}

0 commit comments

Comments
 (0)