Skip to content

Integrity constraint violation error after reordering product with custom options #12705

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

Closed
alena-marchenko opened this issue Dec 14, 2017 · 7 comments
Labels
bug report Component: Catalog Component: Sales Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release

Comments

@alena-marchenko
Copy link

alena-marchenko commented Dec 14, 2017

Preconditions

  1. Magento with Sample Data is installed from 2.2-develop branch

Steps to reproduce

  1. Go to Admin > Products > Catalog
  2. Click Add product button
  3. Fill in information for the item
  • Product name = testprod
  • Sku = testprod
  • Add product to any category
  • At the Configurations section click Edit Configurations button
    -- Select color and size from the list and click Next
    -- Select Colors Black and Blue from the Color Section, and Size S, M, L from the Size section and click Next
    -- At the next screen enter the following configuration:
    --- Images: Skip image uploading at this time
    --- Price: Apply single price to all SKUs = 100
    --- Quantity: Apply single quantity to each Skus = 10
  • At the Customizable Options click on Add Option button
    -- Option 1
    --- Option title: opt1
    --- Option type: radio button
    --- Required: leave it empty
    --- Title: option 1
    --- Price 10.00
    --- Price type: fixed
    --- Sku: 22
    -- Option 2
    --- Option title: opt2
    --- Option type: radio button
    --- Title: option 2
    --- Price 15.00
    --- Price type: fixed
    --- Sku: 21
  • Click Save to save the item.
  1. Go to the Storefront and find the item testprod
  2. Add the first item to the cart by choosing the following configuration:
    • Color: Black
    • Size: S
    • Opt1: option1 + $10.00
    • Opt2: None
    • Qty: 1
  3. Add the second item to the cart by choosing the following configuration:
    Color: Black
    Size: S
    Opt1: None
    Opt2: option2 + $15.00
    Qty: 1
  4. Go to Admin and find your recent order in Sales > Orders
  5. Click on the view link and once the order loads click Reorder button

Expected result

New order page is opened

Actual result

Unable to reorder, error is thrown and logged in var/report

Log from var/report:
[a:4:{i:0;s:386:"SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (dbname.quote_item_option, CONSTRAINT QUOTE_ITEM_OPTION_ITEM_ID_QUOTE_ITEM_ITEM_ID FOREIGN KEY (item_id) REFERENCES quote_item (item_id) ON DELETE CASCADE), query was: INSERT INTO quote_item_option (product_id, code, value) VALUES (?, ?, ?)";i:1;s:13245:"#0 /pathToMagentoFolder/vendor/magento/framework/DB/Statement/Pdo/Mysql.php(95): Zend_Db_Statement_Pdo->_execute(Array)

@alena-marchenko alena-marchenko added Release Line: 2.2 2.2.x Component: Catalog Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Component: Sales bug report labels Dec 14, 2017
@okorshenko okorshenko added mageconf and removed 2.2.x labels Dec 14, 2017
@demtaric
Copy link

#mageconf

@magento-engcom-team
Copy link
Contributor

@demtaric thank you for joining. Please accept team invitation here and self-assign the issue.

@demtaric demtaric self-assigned this Dec 15, 2017
@vinayshah
Copy link
Member

Hello I am looking for this issue #mm18in

@magento-engcom-team
Copy link
Contributor

@vinayshah thank you for joining. Please accept team invitation here and self-assign the issue.

vinayshah added a commit to vinayshah/magento2 that referenced this issue Jan 7, 2018
…product with custom options

- Fixed issue by updating options if parent item is same for more than one product
- Fixed issue for reorder in admin while checking the availability of product, which is not available in case of associate product.
vinayshah added a commit to vinayshah/magento2 that referenced this issue Jan 7, 2018
…product with custom options

- Fixed issue by updating options if parent item is same for more than one product
- Fixed issue for reorder in admin while checking the availability of product, which is not available in case of associate product.
- Fixed Null coalescing operator issue
@magento-team magento-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Jan 11, 2018
@magento-team
Copy link
Contributor

Hi @alena-marchenko. Thank you for your report.
The issue has been fixed in #13036 by @vinayshah in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming patch release.

vinayshah added a commit to vinayshah/magento2 that referenced this issue Jan 26, 2018
…product with custom options

(issue fixed for 2.2-develop)
- Fixed issue by updating options if parent item is same for more than one product
- Fixed issue for reorder in admin while checking the availability of product, which is not available in case of associate product.
@magento-engcom-team
Copy link
Contributor

Hi @alena-marchenko. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Feb 8, 2018
@sidolov
Copy link
Contributor

sidolov commented Apr 5, 2018

Hi @alena-marchenko. Thank you for your report.
The issue has been fixed in #13394 by @vinayshah in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Catalog Component: Sales Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release
Projects
None yet
Development

No branches or pull requests

7 participants