From bc561134866637ff7841cf934b49727ee67b9339 Mon Sep 17 00:00:00 2001 From: Ananth Iyer Date: Wed, 8 Feb 2023 13:56:53 +0530 Subject: [PATCH 1/4] Fix: addFilterToMap function is not working for certain columns #3619 --- .../Model/ResourceModel/Order/OrderGridCollectionFilter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilter.php b/app/code/Magento/Sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilter.php index 743bc83588296..c306998e96fb0 100644 --- a/app/code/Magento/Sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilter.php +++ b/app/code/Magento/Sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilter.php @@ -55,7 +55,7 @@ public function aroundAddFieldToFilter( } } - $fieldName = $subject->getConnection()->quoteIdentifier($field); + $fieldName = $subject->getConnection()->quoteIdentifier('main_table.' . $field); $condition = $subject->getConnection()->prepareSqlCondition($fieldName, $condition); $subject->getSelect()->where($condition, null, Select::TYPE_CONDITION); From 09b760a03c9bdb876084fbbb422ee3845259382a Mon Sep 17 00:00:00 2001 From: Ananth Iyer Date: Sat, 11 Feb 2023 18:18:45 +0530 Subject: [PATCH 2/4] Updated OrderGridCollectionFilterTest file --- .../ResourceModel/Order/OrderGridCollectionFilterTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilterTest.php b/dev/tests/integration/testsuite/Magento/Sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilterTest.php index 718a5f67bb714..d8122fc05788a 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilterTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilterTest.php @@ -80,10 +80,10 @@ public function testAroundAddFieldToFilter($mainTable, $resourceModel, $field, $ if ($mainTable == 'sales_order_grid') { $condition = ['from' => $fieldValue , 'locale' => "en_US", 'datetime' => true]; - $selectCondition = "WHERE (`{$field}` >= '{$convertedDate}')"; + $selectCondition = "WHERE (`main_table`.`{$field}` >= '{$convertedDate}')"; } else { $condition = ['qteq' => $fieldValue]; - $selectCondition = "WHERE (((`{$field}` = '{$convertedDate}')))"; + $selectCondition = "WHERE (((`main_table`.`{$field}` = '{$convertedDate}')))"; } $this->searchResult = $this->objectManager->create( From 2633ccf5443817179d9d6a4eea8b0a7beba60627 Mon Sep 17 00:00:00 2001 From: Ananth Iyer Date: Thu, 2 Mar 2023 14:50:44 +0530 Subject: [PATCH 3/4] Updated Order Grid Collection plugin --- app/code/Magento/Sales/etc/adminhtml/di.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/etc/adminhtml/di.xml b/app/code/Magento/Sales/etc/adminhtml/di.xml index 7ea46d60caeec..c218088183531 100644 --- a/app/code/Magento/Sales/etc/adminhtml/di.xml +++ b/app/code/Magento/Sales/etc/adminhtml/di.xml @@ -49,7 +49,7 @@ - + From 07be6989c1774b605e21ee472e1632454c55b55b Mon Sep 17 00:00:00 2001 From: Ananth Iyer Date: Mon, 8 May 2023 19:07:09 +0530 Subject: [PATCH 4/4] Added creditmemo, shipment, invoice grid plugin --- app/code/Magento/Sales/etc/adminhtml/di.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/code/Magento/Sales/etc/adminhtml/di.xml b/app/code/Magento/Sales/etc/adminhtml/di.xml index c218088183531..65fb65b87529a 100644 --- a/app/code/Magento/Sales/etc/adminhtml/di.xml +++ b/app/code/Magento/Sales/etc/adminhtml/di.xml @@ -52,6 +52,15 @@ + + + + + + + + + \Magento\Catalog\Ui\DataProvider\Product\ProductCollectionFactory