Skip to content

Commit

Permalink
⏫ Forwardport of #12001 to 2.3-develop branch
Browse files Browse the repository at this point in the history
Applied pull request patch https://github.com/magento/magento2/pull/12001.patch (created by @RomaKis) based on commit(s):
  1. 17aa13c
  2. 3f79b80

Fixed GitHub Issues in 2.3-develop branch:
  - #11532: Duplicate Simple Product Throws Error: Undefined offset: 0 in SaveHandler.php on line 122 (reported by @lee586)
  • Loading branch information
magento-engcom-team committed Jan 23, 2018
1 parent 8e77e2f commit 95ed67e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/code/Magento/Catalog/Model/Category/Link/SaveHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ private function mergeCategoryLinks($newCategoryPositions, $oldCategoryPositions

if ($key === false) {
$result[] = $newCategoryPosition;
} elseif ($oldCategoryPositions[$key]['position'] != $newCategoryPosition['position']) {
} elseif (isset($oldCategoryPositions[$key])
&& $oldCategoryPositions[$key]['position'] != $newCategoryPosition['position']
) {
$result[] = $newCategoryPositions[$key];
unset($oldCategoryPositions[$key]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,21 @@ public function getCategoryDataProvider()
],
[], //affected category_ids
],
[
[3], //model category_ids
[
['category_id' => 3, 'position' => 20],
['category_id' => 4, 'position' => 30],
], // dto category links
[
['category_id' => 3, 'position' => 10],
],
[
['category_id' => 3, 'position' => 20],
['category_id' => 4, 'position' => 30],
],
[3, 4], //affected category_ids
],
];
}

Expand Down

0 comments on commit 95ed67e

Please sign in to comment.