Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit bbceef8

Browse files
author
Bohdan Korablov
committed
MAGETWO-86656: app:config:dump doesn't work if run this command twice
1 parent fc97826 commit bbceef8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

app/code/Magento/Config/Model/Config/Importer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ public function import(array $data)
123123
if ($this->scopeConfig instanceof Config) {
124124
$this->scopeConfig->clean();
125125
}
126-
127126
$this->state->emulateAreaCode(Area::AREA_ADMINHTML, function () use ($changedData, $data) {
128127
$this->scope->setCurrentScope(Area::AREA_ADMINHTML);
129128

130129
// Invoke saving of new values.
131130
$this->saveProcessor->process($changedData);
132-
$this->flagManager->saveFlag(static::FLAG_CODE, $data);
133131
});
132+
$this->scope->setCurrentScope($currentScope);
133+
$this->flagManager->saveFlag(static::FLAG_CODE, $data);
134134
} catch (\Exception $e) {
135135
throw new InvalidTransitionException(__('%1', $e->getMessage()), $e);
136136
} finally {

app/code/Magento/Config/Test/Unit/Model/Config/ImporterTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ public function testImport()
156156
$this->scopeMock->expects($this->at(2))
157157
->method('setCurrentScope')
158158
->with('oldScope');
159+
$this->scopeMock->expects($this->at(3))
160+
->method('setCurrentScope')
161+
->with('oldScope');
159162
$this->flagManagerMock->expects($this->once())
160163
->method('saveFlag')
161164
->with(Importer::FLAG_CODE, $data);

0 commit comments

Comments
 (0)