-
Notifications
You must be signed in to change notification settings - Fork 340
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
Mass-adding products to category fails. #414
Comments
Hello @reviskar and thank you for submitting this issue. Does this occur only with ElasticSuite enabled ? I will take a look on this one, |
Hi and thanks for the fast reaction! Yeah. Just to be sure I installed fresh Magento CE 2.1.6, added a few products, did everything as mentioned in "Steps to reproduce" and confirmed everything worked in vanilla Magento2. Then used composer to require smile/elasticsearch and got the error described above. At the moment, as a very, very messy hotfix, I've created a patch that adds a check to the Category Resource class. |
Okay, I reproduce your bug on my environment, I will try to provide a fix for this one. Best regards, |
PR have been merged. |
I have got this exact issue on Magento 2.4.1 and Elasticsuite 2.10.3 |
2.10.5 / magento 2.4.2-p1: problem persists. |
Mass-adding products to category results in duplicate entry insert.
Preconditions
Magento Version : CE 2.1.5 && CE 2.1.6
ElasticSuite Version : 2.3.4 && 2.3.5
Environment : Dev/Prod
Third party modules : -
Steps to reproduce
Expected result
Actual result
INSERT INTO
catalog_category_product(
category_id,
product_id,
position) VALUES (?, ?, ?), (?, ?, ?)
What I think that happens is, that the "Select all" checkbox is treated as a product checkbox, so vendor/magento/module-catalog/Model/ResourceModel/Category.php:391 gets an element that is with the string 'on' as an array key. That translates into a product array element with
product_id => 0
. When trying to save that element an exception is thrown.I've just re-validated this error with a fresh magento install and only "smile/elasticsuite" as a composer dependancy.
Thanks in advance.
The text was updated successfully, but these errors were encountered: