-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Preconditions and environment
Magento Version: Magento Open Source 2.4.8-p3
PHP Version: PHP 8.4.15
Steps to reproduce
- In Magento Admin, go to Sales → Orders
- Select the 'Purchase Date' filter, and apply the filter.
Expected result
Display orders by purchase date after filter.
Actual result
An error message is displayed, indicating that the filter is invalid or not supported.
Additional information
The PayPal_Braintree module introduces a plugin on
vendor/paypal/module-braintree-core/Plugin/SalesOrderGridPlugin.php
which rewrites SQL WHERE conditions incorrectly.
When the order grid is filtered by Created At, the plugin attempts to rewrite:
`created_at`
→
`main_table`.`created_at`
However, if the condition already contains a table alias, the plugin rewrites it again, causing the final SQL to become:
(((`main_table`.`main_table`.`created_at` >= '2025-11-30 12:00:00')))
This produces invalid SQL and breaks the order grid.
Affected File: vendor/paypal/module-braintree-core/Plugin/SalesOrderGridPlugin.php
Problematic Code
$wherePart[$key] = str_replace("`created_at`", "`main_table`.`created_at`", $condition);
This code runs even when the condition already contains
`main_table`.`created_at`
leading to:
`main_table`.`main_table`.`created_at`
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
Type
Projects
Status