Skip to content

Commit 6d49300

Browse files
author
Mohan Ahuja
committed
ACP2E-726: Unable to query bulk operations by search criteria using REST Api
- Implemented another solution without plugin, by updating collection only while fetching the records
1 parent 0d44ee8 commit 6d49300

File tree

3 files changed

+3
-42
lines changed

3 files changed

+3
-42
lines changed

app/code/Magento/AsynchronousOperations/Model/OperationRepository.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCr
9797

9898
/** @var \Magento\AsynchronousOperations\Model\ResourceModel\Operation\Collection $collection */
9999
$collection = $this->collectionFactory->create();
100+
$collection->addFieldToSelect('id', 'operation_key');
101+
$collection->addFieldToSelect('operation_key', 'id');
102+
$collection->addFieldToSelect(['bulk_uuid', 'topic_name', 'serialized_data', 'result_serialized_data', 'status', 'error_code', 'result_message', 'started_at']);
100103
$this->joinProcessor->process($collection, \Magento\AsynchronousOperations\Api\Data\OperationInterface::class);
101104
$this->collectionProcessor->process($searchCriteria, $collection);
102105
$searchResult->setSearchCriteria($searchCriteria);

app/code/Magento/AsynchronousOperations/Plugin/CollectionUpdater.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

app/code/Magento/AsynchronousOperations/etc/di.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@
116116
<argument name="bulkManagement" xsi:type="object">Magento\AsynchronousOperations\Model\VirtualType\BulkManagement</argument>
117117
</arguments>
118118
</type>
119-
<type name="Magento\Framework\Data\Collection\AbstractDb">
120-
<plugin name="collection_updater" type="Magento\AsynchronousOperations\Plugin\CollectionUpdater"/>
121-
</type>
122119
<preference for="Magento\AsynchronousOperations\Api\Data\AsyncResponseInterface" type="Magento\AsynchronousOperations\Model\AsyncResponse" />
123120
<preference for="Magento\AsynchronousOperations\Api\Data\ItemStatusInterface" type="Magento\AsynchronousOperations\Model\ItemStatus" />
124121
</config>

0 commit comments

Comments
 (0)