-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Conversation
} elseif ($oldCategoryPositions[$key]['position'] != $newCategoryPosition['position']) { | ||
$result[] = $newCategoryPositions[$key]; | ||
unset($oldCategoryPositions[$key]); | ||
} elseif (isset($oldCategoryPositions[$key])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I do not think we need the nested if here. I think we could cover this check via
} elseif (
isset($oldCategoryPositions[$key])
&& $oldCategoryPositions[$key]['position'] != $newCategoryPosition['position']
) {
Or have I missed something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmanners, yes, you are right. It is fixed and squashed.
…SaveHandler.php on line 122
@RomaKis There appears to be a small style problem.
|
…SaveHandler.php on line 122
@dmanners, fixed. |
@RomaKis thanks |
…d offset: 0 in SaveHandler.php on line 122 #12001
@dmanners, fixed |
Fixed Issues (if relevant)
Manual testing scenarios
Precondition
Two cases:
Create simple product and export his, delete product in catalog manager, and import file from product.
or
Create simple product, and update Magento from 2.1.8 or 2.1.9 to 2.2.0.
Steps to reproduce:
Expected result
The product saves and creates a duplicate item.
Actual result
Saves the product but doesn't duplicate it. Throws the following error:
Notice: Undefined offset: 0 in /home/store/public_html/vendor/magento/module-catalog/Model/Category/Link/SaveHandler.php on line 122
Contribution checklist