Skip to content

Commit 1c314c0

Browse files
SarmisthaSarmistha
authored andcommitted
Merge remote-tracking branch 'adobe-commerce-tier-4/ACP2E-2944' into Tier4-Kings-PR-06-03-2024
2 parents 47b24df + cfb0848 commit 1c314c0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

app/code/Magento/Sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function aroundAddFieldToFilter(
5555
}
5656
}
5757

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

app/code/Magento/Sales/etc/adminhtml/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
</arguments>
5050
<plugin name="orderGridExportFilterColumnPlugin" type="Magento\Sales\Plugin\Model\Export\OrderGridExportFilterColumn"/>
5151
</type>
52-
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
52+
<type name="Magento\Sales\Model\ResourceModel\Order\Grid\Collection">
5353
<plugin name="orderGridCollectionFilterPlugin" type="Magento\Sales\Plugin\Model\ResourceModel\Order\OrderGridCollectionFilter"/>
5454
</type>
5555
<type name="Magento\Sales\Block\Adminhtml\Order\Create\Search\Grid\DataProvider\ProductCollection">

dev/tests/integration/testsuite/Magento/Sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ public function testAroundAddFieldToFilter($mainTable, $resourceModel, $field, $
8080

8181
if ($mainTable == 'sales_order_grid') {
8282
$condition = ['from' => $fieldValue , 'locale' => "en_US", 'datetime' => true];
83-
$selectCondition = "WHERE (`{$field}` >= '{$convertedDate}')";
83+
$selectCondition = "WHERE (`main_table`.`{$field}` >= '{$convertedDate}')";
8484
} else {
8585
$condition = ['qteq' => $fieldValue];
86-
$selectCondition = "WHERE (((`{$field}` = '{$convertedDate}')))";
86+
$selectCondition = "WHERE (((`main_table`.`{$field}` = '{$convertedDate}')))";
8787
}
8888

8989
$this->searchResult = $this->objectManager->create(

0 commit comments

Comments
 (0)