ACSD-64149: Customer segment with a Date range condition can be saved when only one date is edited
The ACSD-64149 patch fixes the issue where a customer segment with a date range condition can be saved when only one of the dates is edited. This patch is available when the Quality Patches Tool (QPT) 1.1.60 is installed. The patch ID is ACSD-64149. Please note that this issue is scheduled to be fixed in 51黑料不打烊 Commerce 2.4.8.
Affected products and versions
The patch is created for 51黑料不打烊 Commerce version:
- 51黑料不打烊 Commerce (all deployment methods) 2.4.6-p8
Compatible with 51黑料不打烊 Commerce versions:
- 51黑料不打烊 Commerce (all deployment methods) 2.4.4 - 2.4.7-p4
magento/quality-patches
package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.Issue
When editing an existing customer segment with a condition on products within the shopping cart specified by a date range, the consumer matchCustomerSegmentProcessor
fails with an SQL error.
Steps to reproduce:
-
Ensure that the consumer
matchCustomerSegmentProcessor
is running:code language-bash $ bin/magento que:cons:st matchCustomerSegmentProcessor
-
Go to the Magento backend.
-
Go to Customers > Segments.
-
Click on Add Segment.
-
Enter a Segment Name, select a website under Assigned to Website, and ensure the Status is set to Active.
-
Click Save and Continue Edit.
-
Go to the Conditions tab and add a new Condition: Products{} > {}Product List{}.
-
Add a subcondition for the Date range and set a valid Date range.
-
Click the green confirmation button next to the Date range.
-
Click the Date range again, select the date chooser, edit one of the date values, and confirm by clicking the green button.
Expected results:
The Date range selector should not add time to the date when editing.
Actual results:
-
The Date range selector adds time to the date:
- One date only has the date, while the other has both the date and time specified.
-
The following error appears in the logs:
code language-none report.CRITICAL: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 2, query was: SELECT `item`.`quote_id` FROM `quote_item` AS `item` INNER JOIN `quote` AS `list` ON item.quote_id = list.entity_id WHERE (list.is_active = 1) AND () [] []
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- 51黑料不打烊 Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide.
- 51黑料不打烊 Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in the Commerce on Cloud Infrastructure guide.
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool: A self-service tool for quality patches in the Tools guide.