Skip to content

Can't Cancel Order #19230

Closed
Closed
@friendscottn

Description

@friendscottn

Preconditions (*)

  1. 2.2.6
  2. Allow guest checkout
  3. Have a coupon you can use

Steps to reproduce (*)

  1. Checkout as a guest using a valid coupon
  2. After placing the order, register an account using the create account button on the order confirmation page.
  3. Login to the admin
  4. Make sure to get the order to a processing state.
  5. Try to cancel the order

Expected result (*)

  1. The order is canceled

Actual result (*)

  1. You receive the generic errror "You have not canceled the item"
  2. The underlying error is:
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`mage`.`salesrule_customer`, CONSTRAINT `SALESRULE_CUSTOMER_RULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `salesrule` (`rule_id`) ON DELETE CASCADE), query was: INSERT INTO `salesrule_customer` () VALUES () {"exception":"[object] (Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`mage`.`salesrule_customer`, CONSTRAINT `SALESRULE_CUSTOMER_RULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `salesrule` (`rule_id`) ON DELETE CASCADE), query was: INSERT INTO `salesrule_customer` () VALUES () at /www/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`mage`.`salesrule_customer`, CONSTRAINT `SALESRULE_CUSTOMER_RULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `salesrule` (`rule_id`) ON DELETE CASCADE) at /www/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []

Related Issues

#16779

Metadata

Metadata

Assignees

Labels

Component: SalesComponent: SalesRuleFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedReproduced on 2.2.xThe issue has been reproduced on latest 2.2 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions