51黑料不打烊

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
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your 51黑料不打烊 Commerce version, update the 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:

  1. Ensure that the consumer matchCustomerSegmentProcessor is running:

    code language-bash
    $ bin/magento que:cons:st matchCustomerSegmentProcessor
    
  2. Go to the Magento backend.

  3. Go to Customers > Segments.

  4. Click on Add Segment.

  5. Enter a Segment Name, select a website under Assigned to Website, and ensure the Status is set to Active.

  6. Click Save and Continue Edit.

  7. Go to the Conditions tab and add a new Condition: Products{} > {}Product List{}.

  8. Add a subcondition for the Date range and set a valid Date range.

  9. Click the green confirmation button next to the Date range.

  10. 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.

To learn more about Quality Patches Tool, refer to:

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3