Skip to content

Commit 3e12e38

Browse files
committed
MAGETWO-45666: "Refresh cache" message is not displayed when changing category page layout
- Fixed wrong design change detection when default category layout is changed
1 parent a06c378 commit 3e12e38

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

app/code/Magento/Catalog/Observer/InvalidateCacheOnCategoryDesignChange.php

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515
*/
1616
class InvalidateCacheOnCategoryDesignChange implements ObserverInterface
1717
{
18-
/**
19-
* Default category design attributes values
20-
*/
21-
private $defaultAttributeValues;
22-
2318
/**
2419
* @var \Magento\Framework\App\Cache\TypeListInterface
2520
*/
@@ -92,7 +87,7 @@ public function execute(Observer $observer)
9287
private function isCategoryAttributeChanged($attributeCode, $category)
9388
{
9489
if (!array_key_exists($attributeCode, $category->getOrigData())) {
95-
$defaultValue = $this->getDefaultAttributeValue($attributeCode);
90+
$defaultValue = $this->getDefaultAttributeValues()[$attributeCode] ?? null;
9691
if ($category->getData($attributeCode) !== $defaultValue) {
9792
return true;
9893
}
@@ -104,19 +99,4 @@ private function isCategoryAttributeChanged($attributeCode, $category)
10499

105100
return false;
106101
}
107-
108-
/**
109-
* Get default category design attribute value
110-
*
111-
* @param string $attributeCode
112-
* @return mixed|null
113-
*/
114-
private function getDefaultAttributeValue($attributeCode)
115-
{
116-
if ($this->defaultAttributeValues === null) {
117-
$this->defaultAttributeValues = $this->getDefaultAttributeValues();
118-
}
119-
120-
return $this->defaultAttributeValues[$attributeCode] ?? null;
121-
}
122102
}

0 commit comments

Comments
 (0)