Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

11532: Duplicate Simple Product Throws Error: Undefined offset: 0 in SaveHandler.php on line 122 #12001

Merged
merged 2 commits into from Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/code/Magento/Catalog/Model/Category/Link/SaveHandler.php
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
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