QUALITY PATCH

MDVA-43824: Order placed by a logged-in customer cannot be cancelled

Order placed by a logged-in customer cannot be cancelled. Quality patch MDVA-43824 for magento/module-sales-rule applies to Magento Open Source and Adobe Commerce 2.3.6 to 2.4.4-p11.

Categories
Order/Checkout
Components
magento/module-sales-rule
Origin
adobe-commerce-support
Since QPT
1.1.13

Issue

Order placed by a logged-in customer cannot be cancelled. The order cancellation action failed with the following error: Zend_Db_Statement_Exception: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (mer33515_ee24developpbdevelop.salesrule_customer, CONSTRAINT SALESRULE_CUSTOMER_RULE_ID_SEQUENCE_SALESRULE_SEQUENCE_VALUE FOREIGN KEY (rule_id) REFERENCES sequence_salesrule (sequen), query was: INSERT INTO salesrule_customer () VALUES (){code}

Steps to reproduce

1. Create a sales rule (coupon type is either "Specific Coupon" or "No Coupon"). 1. Go to the storefront and log in as a customer and add a product to the cart. 1. Go to the cart and apply the cart price rule if the cart price rule has a coupon as "Specific Coupon". The cart price rule should be applied successfully. 1. Go to checkout and place the order with any payment method. 1. Go to the Commerce Admin > Sales > Orders. 1. Open the order placed in Step 4. 1. Click on the Cancel button.

Adobe's page lists 2.3.6 - 2.3.7-p3, 2.4.1 - 2.4.4 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.

Adobe scheduled the permanent fix for 2.4.5.

Install

Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply MDVA-43824. On Cloud, add MDVA-43824 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its MDVA-43824/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.

Patch files and compatible versions

Packages across compatible versions (1): magento/module-sales-rule
Packages across compatible versions (1): magento/module-sales-rule

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.