Skip to content

Commit

Permalink
Merge branch 'fix-issue-36719' of https://github.com/ananth-iyer/mage…
Browse files Browse the repository at this point in the history
…nto2 into ACP2E-2944
  • Loading branch information
glanujnehra committed Mar 28, 2024
2 parents 488c103 + 01199a4 commit f09c222
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
11 changes: 10 additions & 1 deletion app/code/Magento/Sales/etc/adminhtml/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,18 @@
</arguments>
<plugin name="orderGridExportFilterColumnPlugin" type="Magento\Sales\Plugin\Model\Export\OrderGridExportFilterColumn"/>
</type>
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
<type name="Magento\Sales\Model\ResourceModel\Order\Grid\Collection">
<plugin name="orderGridCollectionFilterPlugin" type="Magento\Sales\Plugin\Model\ResourceModel\Order\OrderGridCollectionFilter"/>
</type>
<type name="Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection">
<plugin name="invoiceGridCollectionFilterPlugin" type="Magento\Sales\Plugin\Model\ResourceModel\Order\OrderGridCollectionFilter"/>
</type>
<type name="Magento\Sales\Model\ResourceModel\Order\Creditmemo\Order\Grid\Collection">
<plugin name="creditmemoGridCollectionFilterPlugin" type="Magento\Sales\Plugin\Model\ResourceModel\Order\OrderGridCollectionFilter"/>
</type>
<type name="Magento\Sales\Model\ResourceModel\Order\Shipment\Order\Grid\Collection">
<plugin name="shipmentGridCollectionFilterPlugin" type="Magento\Sales\Plugin\Model\ResourceModel\Order\OrderGridCollectionFilter"/>
</type>
<type name="Magento\Sales\Block\Adminhtml\Order\Create\Search\Grid\DataProvider\ProductCollection">
<arguments>
<argument name="collectionFactory" xsi:type="object">\Magento\Catalog\Ui\DataProvider\Product\ProductCollectionFactory</argument>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit f09c222

Please sign in to comment.