Skip to content

Integrity constraint violation when filtering sales order grid by date #38818

@cjohnsen1

Description

@cjohnsen1

Preconditions and environment

Magento 2.4.7. I have reproduced this issue on an upgrade from 2.4.6-p3 as well as a clean install of 2.4.7.

Steps to reproduce

  1. Navigate to storefront admin.
  2. Navigate to Sales/Orders.
  3. Click "Filters".
  4. Select a "From" and "To" purchase date.
  5. Click "Apply Filters"

Expected result

Order grid is updated with a list of orders placed during the time period selected.

Actual result

Dialog "Attention: Something went wrong." along with a message stating "Something went wrong with processing the default view and we have restored the filter to its original state."

Additional information

Error Message (Store URL redacted):

Next Zend_Db_Statement_Exception: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous, query was: SELECT main_table.*, braintree_transaction_details.transaction_source, sales_order.dispute_status FROM sales_order_grid AS main_table
LEFT JOIN braintree_transaction_details ON braintree_transaction_details.order_id = main_table.entity_id
LEFT JOIN sales_order ON sales_order.entity_id = main_table.entity_id WHERE (((created_at >= '2024-06-03 05:00:00'))) AND (((created_at <= '2024-06-06 04:59:59'))) ORDER BY main_table.increment_id DESC
LIMIT 20 in /var/www/vhosts/[storeURL]/httpdocs/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:109

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Issue: needs updateAdditional information is require, waiting for responseReported on 2.4.7Indicates original Magento version for the Issue report.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions