magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

OrderGridCollectionFilter Plugin Breaks Mapping for created_at Column #38916

Closed sgeleon closed 2 months ago

sgeleon commented 4 months ago

Preconditions and environment

Steps to reproduce

STEPS TO REPRODUCE Sales > Orders Filters > set Purchase Date from and to Click Apply Filters

image

Expected result

The filters are applied.

Actual result

'Something went wrong with processing the default view and we have restored the filter to its original state.

Additional information

This problem is same like from this bug report.

This plugin is fixed it.

Index: vendor/magento/module-sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilter.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/vendor/magento/module-sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilter.php b/vendor/magento/module-sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilter.php
--- a/vendor/magento/module-sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilter.php    
+++ b/vendor/magento/module-sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilter.php    (date 1717557636000)
@@ -56,7 +56,7 @@
             }

             $fieldName = $subject->getConnection()->quoteIdentifier($field);
-            $condition = $subject->getConnection()->prepareSqlCondition($fieldName, $condition);
+            $condition = $subject->getConnection()->prepareSqlCondition('`main_table`.'.$fieldName, $condition);
             $subject->getSelect()->where($condition, null, Select::TYPE_CONDITION);

             return $subject;

Release note

No response

Triage and priority

m2-assistant[bot] commented 4 months ago

Hi @sgeleon. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

m2-assistant[bot] commented 4 months ago

Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:


engcom-Dash commented 4 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 4 months ago

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 4 months ago

Hi @engcom-Dash, here is your Magento Instance: https://2dee4f3e57d1e8b3dcd060f3fc05d923.instances-prod.magento-community.engineering Admin access: https://2dee4f3e57d1e8b3dcd060f3fc05d923.instances-prod.magento-community.engineering/admin_088d Login: ffc4092e Password: f6036bfdcba1

engcom-Dash commented 4 months ago

Hi @sgeleon

Thanks for reporting and collaboration.

Verified the issue on Magento 2.4 dev instance but the issue is not reproducible.

However, we can reproduce the issue on 2.4.7-p1.

The issue might have been fixed in the latest 2.4 dev branch.

Steps to reproduce STEPS TO REPRODUCE Sales > Orders Filters > set Purchase Date from and to Click Apply Filters

Please refer the attached screen-recording.

In 2.4 dev instance:

https://github.com/user-attachments/assets/00da1345-83b3-47ed-9afa-85e29b0e50cf

In 2.4.7-p1:

Screenshot 2024-07-16 at 4 22 04 PM
hclauss-ltk commented 4 months ago

Hello together,

we have the same issue and can´t filter our products anymore, same error applies. Also since the error occurs, we can´t even see the unfiltered product overview anymore. Are there any updates how to reset this?

Thanks in advance!

engcom-Dash commented 3 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 3 months ago

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 3 months ago

Hi @engcom-Dash, here is your Magento Instance: https://2dee4f3e57d1e8b3dcd060f3fc05d923.instances-prod.magento-community.engineering Admin access: https://2dee4f3e57d1e8b3dcd060f3fc05d923.instances-prod.magento-community.engineering/admin_fa25 Login: ccfc4daa Password: 7bc925ecfd0e

engcom-Dash commented 3 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 3 months ago

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 3 months ago

Hi @engcom-Dash, here is your Magento Instance: https://2dee4f3e57d1e8b3dcd060f3fc05d923.instances-prod.magento-community.engineering Admin access: https://2dee4f3e57d1e8b3dcd060f3fc05d923.instances-prod.magento-community.engineering/admin_b6dd Login: 49787e9a Password: 7e28d927c3b2

engcom-Dash commented 3 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 3 months ago

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 3 months ago

Hi @engcom-Dash, here is your Magento Instance: https://2dee4f3e57d1e8b3dcd060f3fc05d923.instances-prod.magento-community.engineering Admin access: https://2dee4f3e57d1e8b3dcd060f3fc05d923.instances-prod.magento-community.engineering/admin_4262 Login: 82f621ed Password: 3ddf6a42d3b6

engcom-Dash commented 3 months ago

Hi @sgeleon

We have verified the issue on 2.4 dev instance but the issue is not reproducible.

Please look into the screenshots attached.

Screenshot 2024-07-23 at 11 04 06 AM

Let us know if we missed anything.

Thanks.

Bashev commented 3 months ago

Fixed in https://github.com/magento/magento2/pull/36818, but it's never released. https://github.com/magento/magento2/blob/11e7d89380c3ef9b9bd18c1d8b7815b0fad96e34/app/code/Magento/Sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilter.php#L58

@engcom-Dash can you confirm, this will comes with next release?

m2-assistant[bot] commented 3 months ago

Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

Bashev commented 2 months ago

@engcom-Hotel what kind of update is required here? As i mentioned above, PR is merged (https://github.com/magento/magento2/commit/f09c22200da0e9cb4481c953ebc0d1ce3a226f38), but somehow is not released in 2.4.7-p2

engcom-Hotel commented 2 months ago

Hello @Bashev,

Thanks for your query!

We have started a discussion internally on your query and will reply you back ASAP on this.

Meanwhile moving this issue on hold.

Thanks

engcom-Hotel commented 2 months ago

Hello @Bashev,

We have just received a reply from the internal team. The fix will be released in the 2.4.8 version.

Thanks

dchaykas commented 2 months ago

@engcom-Hotel will the fix address https://github.com/magento/magento2/issues/39000 as well? If yes, then it can be closed with a comment.