Skip to content

Commit

Permalink
Prevent side effect on category objects store_id and url_key on save
Browse files Browse the repository at this point in the history
  • Loading branch information
schmengler committed May 8, 2020
1 parent 6b6f428 commit 7bd5e25
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ protected function generateForGlobalScope(
$mergeDataProvider = clone $this->mergeDataProviderPrototype;
$categoryId = $category->getId();
foreach ($category->getStoreIds() as $storeId) {
if ($storeId !== Store::DEFAULT_STORE_ID) {
$category = clone $category; // prevent undesired side effects on original object
}
$category->setStoreId($storeId);
if (!$this->isGlobalScope($storeId)
&& $this->isOverrideUrlsForStore($storeId, $categoryId, $overrideStoreUrls)
Expand Down

0 comments on commit 7bd5e25

Please sign in to comment.