Skip to content

Commit 1ecb87e

Browse files
author
Mohan Ahuja
committed
ACP2E-726: Unable to query bulk operations by search criteria using REST Api
- Fixing static failure
1 parent d9778af commit 1ecb87e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ class CollectionUpdater
1919
* Adds id value in operation_key in case of bulk operation
2020
*
2121
* @param AbstractDb $subject
22-
* @param $result
22+
* @param array|null $result
2323
* @return array
2424
* @throws \Magento\Framework\Exception\LocalizedException
2525
*/
26-
public function afterGetData(AbstractDb $subject, $result)
26+
public function afterGetData(AbstractDb $subject, ?array $result)
2727
{
2828
if (is_array($result) && !empty($result) &&
29-
$subject->getResource()->getMainTable() == "magento_operation" &&
30-
$subject->getResource()->getTable('magento_bulk') == "magento_bulk"
29+
$subject->getResource()->getTable('magento_bulk') == "magento_bulk" &&
30+
isset($result[0][OperationInterface::ID])
3131
) {
3232
foreach ($result as $key => $row) {
3333
$result[$key][OperationInterface::ID] = $row['id'];

0 commit comments

Comments
 (0)