Skip to content

Commit b774ded

Browse files
committed
MAGETWO-53056: Category tree is not refreshed after changing category URL suffix
1 parent 860da00 commit b774ded

File tree

1 file changed

+6
-16
lines changed
  • app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite

1 file changed

+6
-16
lines changed

app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ public function afterSave()
9494
if ($this->isValueChanged()) {
9595
$this->updateSuffixForUrlRewrites();
9696
if ($this->isCategorySuffixChanged()) {
97-
$this->invalidateCategoryRelatedCache();
97+
$this->cacheTypeList->invalidate([
98+
\Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER,
99+
\Magento\Framework\App\Cache\Type\Collection::TYPE_IDENTIFIER
100+
]);
98101
}
99102
}
100103
return parent::afterSave();
@@ -105,25 +108,12 @@ public function afterSave()
105108
*
106109
* @return bool
107110
*/
108-
protected function isCategorySuffixChanged()
111+
private function isCategorySuffixChanged()
109112
{
110-
return $this->isValueChanged()
113+
return $this->isValueChanged()
111114
&& ($this->getPath() == CategoryUrlPathGenerator::XML_PATH_CATEGORY_URL_SUFFIX);
112115
}
113116

114-
/**
115-
* Invalidate cache that store old category suffix
116-
*
117-
* @return void
118-
*/
119-
protected function invalidateCategoryRelatedCache()
120-
{
121-
$this->cacheTypeList->invalidate([
122-
\Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER,
123-
\Magento\Framework\App\Cache\Type\Collection::TYPE_IDENTIFIER
124-
]);
125-
}
126-
127117
/**
128118
* Update suffix for url rewrites
129119
*

0 commit comments

Comments
 (0)