Skip to content

Commit 3a565ed

Browse files
committed
MAGETWO-45666: "Refresh cache" message is not displayed when changing category page layout
- Fixed false design change detection when category created via API
1 parent bee0050 commit 3a565ed

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

app/code/Magento/Catalog/Model/CategoryRepository.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Catalog\Api\Data\CategoryInterface;
1414

1515
/**
16+
* Category repository
1617
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1718
*/
1819
class CategoryRepository implements \Magento\Catalog\Api\CategoryRepositoryInterface
@@ -70,7 +71,7 @@ public function __construct(
7071
}
7172

7273
/**
73-
* {@inheritdoc}
74+
* @inheritdoc
7475
*/
7576
public function save(\Magento\Catalog\Api\Data\CategoryInterface $category)
7677
{
@@ -106,6 +107,8 @@ public function save(\Magento\Catalog\Api\Data\CategoryInterface $category)
106107
$parentCategory = $this->get($parentId, $storeId);
107108
$existingData['path'] = $parentCategory->getPath();
108109
$existingData['parent_id'] = $parentId;
110+
$existingData['custom_apply_to_products'] = $existingData['custom_apply_to_products'] ?? 0;
111+
$existingData['custom_use_parent_settings'] = $existingData['custom_use_parent_settings'] ?? 0;
109112
}
110113
$category->addData($existingData);
111114
try {
@@ -125,7 +128,7 @@ public function save(\Magento\Catalog\Api\Data\CategoryInterface $category)
125128
}
126129

127130
/**
128-
* {@inheritdoc}
131+
* @inheritdoc
129132
*/
130133
public function get($categoryId, $storeId = null)
131134
{
@@ -146,7 +149,7 @@ public function get($categoryId, $storeId = null)
146149
}
147150

148151
/**
149-
* {@inheritdoc}
152+
* @inheritdoc
150153
*/
151154
public function delete(\Magento\Catalog\Api\Data\CategoryInterface $category)
152155
{
@@ -167,7 +170,7 @@ public function delete(\Magento\Catalog\Api\Data\CategoryInterface $category)
167170
}
168171

169172
/**
170-
* {@inheritdoc}
173+
* @inheritdoc
171174
*/
172175
public function deleteByIdentifier($categoryId)
173176
{
@@ -208,6 +211,8 @@ protected function validateCategory(Category $category)
208211
}
209212

210213
/**
214+
* Get extensible data object converter
215+
*
211216
* @return \Magento\Framework\Api\ExtensibleDataObjectConverter
212217
*
213218
* @deprecated 101.0.0
@@ -222,6 +227,8 @@ private function getExtensibleDataObjectConverter()
222227
}
223228

224229
/**
230+
* Get metadata pool
231+
*
225232
* @return \Magento\Framework\EntityManager\MetadataPool
226233
*/
227234
private function getMetadataPool()

0 commit comments

Comments
 (0)