Only able to replicate error on simple products that were created before version 2.2. Products I had created under 2.18 won't duplicate. New products created under 2.2 successfully duplicate.
Same issue here for the M2.2 can not duplicate the products.
After click the " save&duplicate"
Notice: Undefined offset: 0 in /var/www/wowlla.com/vendor/magento/module-catalog/Model/Category/Link/SaveHandler.php on line 122
@lee586, thank you for your report.
We've created internal ticket(s) MAGETWO-82173 to track progress on the issue.
Same issue on 2.2.0...
Never happened before
The same problem to me.
after upgrade to 2.2.0
same problem here 2.2.0
the product dosen't duplicate and show it saved bu nothing happen with the same error :
Notice: Undefined offset: 0 in /vendor/magento/module-catalog/Model/Category/Link/SaveHandler.php on line 122
here is the solution for duplicate product :
go to your magento root dir then : /vendor/magento/module-catalog/Model/Category/Link/SaveHandler.php
replace the tset in mergeCategoryLinks function by this :
if ($key === false) {
$result[] = $newCategoryPosition;
} elseif (isset($oldCategoryPositions[$key])) {
if(intval($oldCategoryPositions[$key]['position']) != $newCategoryPosition['position']){
$result[] = $newCategoryPositions[$key];
unset($oldCategoryPositions[$key]);
}
}
When i change the code the result is:
The value specified in the URL Key field would generate a URL that already exists.
To resolve this conflict, you can either change the value of the URL Key field (located in the Search Engine Optimization section) to a unique value, or change the Request Path fields in all locations listed below:
laptop-asus-rog-g752vy-gc100d-1.html
kompjutri-i-laptopi/laptopi/laptopi-novi/laptop-asus-rog-g752vy-gc100d-1.html
gamers-1/gejm-rski-laptopi/laptop-asus-rog-g752vy-gc100d-1.html
@keanass , This show for me http error 500 and No data to save. Error log, PHP Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) in /vendor/magento/module-catalog/Model/Category/Link/SaveHandler.php on line 133
I have magento 2.2 same problem duplicate Simple Product doesn't work.
do anybody have a decision for this problem?
Does anyone knows if is this fixed in 2.2.1 ? I'm also facing this issue in 2.2.0
Here we meet with anther issue "Invalid option value" when save the products at MCE 2.2.1
The issue has been fixed and delivered to 2.2-develop branch. Will be available with 2.2.2 release
@sitiodocanoamarelo Same issue here on a 2.2.1 . I confirm the fix given by @keanass works for us. We also have the "follow-up" error about URL rewrites - not sure if that is related. Dealing with imported products I suspect it has something to do with the store_id of relevant attribute_values.
Btw from my experience and code reading, ugly workaround is to remove the product from all categories (or all but one?).
Thanks @fwolfst ,
I confirm both advices.
If I remove all the categories except one the issue is gone.
Fix by @keanass works for me on a 2.2.0 (thanks @keanass ;)
Hi @lee586. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1289 by @magento-engcom-team in 2.3-develop branch
Related commit(s):
The fix will be available with the upcoming patch release.
configurable products ......Save and Duplicated product not working??
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
do you have any solution ??
still broken in 2.3, fix not working.
Most helpful comment
here is the solution for duplicate product :
go to your magento root dir then : /vendor/magento/module-catalog/Model/Category/Link/SaveHandler.php
replace the tset in mergeCategoryLinks function by this :
if ($key === false) {
$result[] = $newCategoryPosition;
} elseif (isset($oldCategoryPositions[$key])) {
if(intval($oldCategoryPositions[$key]['position']) != $newCategoryPosition['position']){
$result[] = $newCategoryPositions[$key];
unset($oldCategoryPositions[$key]);
}
}