Skip to content

Commit e1e7b14

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-81469: Cached Config is Different From DB
1 parent 2f655dd commit e1e7b14

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

app/code/Magento/Config/App/Config/Type/System.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ public function __construct(
123123
public function get($path = '')
124124
{
125125
if ($path === '') {
126-
$this->data = array_replace_recursive($this->data, $this->loadAllData());
126+
$this->data = array_replace_recursive($this->data, $allData = $this->loadAllData());
127+
$allData = $this->postProcessor->process($allData);
128+
$this->data = array_replace_recursive($this->data, $allData);
127129

128130
return $this->data;
129131
}
@@ -154,7 +156,9 @@ private function getWithParts($path)
154156

155157
if ($scopeType === ScopeInterface::SCOPE_DEFAULT) {
156158
if (!isset($this->data[$scopeType])) {
157-
$this->data = array_replace_recursive($this->data, $this->loadDefaultScopeData($scopeType));
159+
$this->data = array_replace_recursive($this->data, $scopeData = $this->loadDefaultScopeData($scopeType));
160+
$scopeData = $this->postProcessor->process($scopeData);
161+
$this->data = array_replace_recursive($this->data, $scopeData);
158162
}
159163

160164
return $this->getDataByPathParts($this->data[$scopeType], $pathParts);
@@ -165,6 +169,8 @@ private function getWithParts($path)
165169
if (!isset($this->data[$scopeType][$scopeId])) {
166170
$scopeData = $this->loadScopeData($scopeType, $scopeId);
167171
$this->data = array_replace_recursive($this->data, $scopeData);
172+
$scopeData = $this->postProcessor->process($scopeData);
173+
$this->data = array_replace_recursive($this->data, $scopeData);
168174
}
169175

170176
return isset($this->data[$scopeType][$scopeId])
@@ -186,7 +192,6 @@ private function loadAllData()
186192
} else {
187193
$data = $this->serializer->unserialize($cachedData);
188194
}
189-
$data = $this->postProcessor->process($data);
190195

191196
return $data;
192197
}
@@ -207,7 +212,6 @@ private function loadDefaultScopeData($scopeType)
207212
} else {
208213
$data = [$scopeType => $this->serializer->unserialize($cachedData)];
209214
}
210-
$data = $this->postProcessor->process($data);
211215

212216
return $data;
213217
}
@@ -238,7 +242,6 @@ private function loadScopeData($scopeType, $scopeId)
238242
} else {
239243
$data = [$scopeType => [$scopeId => $this->serializer->unserialize($cachedData)]];
240244
}
241-
$data = $this->postProcessor->process($data);
242245

243246
return $data;
244247
}

0 commit comments

Comments
 (0)