-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Issue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passed
Description
Preconditions (*)
- Magento 2.3.1
Steps to reproduce (*)
- Create a new bulk schedule
$bulkDescription = $this->getBulkMessage($order);
$bulkUuid = $this->identityService->generateId();
$data = ['just' => 'some dummy'];
$operationData = [
'data' => [
'bulk_uuid' => $bulkUuid,
'topic_name' => self::TOPIC_NAME,
'serialized_data' => $this->serializer->serialize($data),
'status' => \Magento\Framework\Bulk\OperationInterface::STATUS_TYPE_OPEN,
]
];
$operation = $this->operationsFactory->create($operationData);
$this->bulkManagement->scheduleBulk(
$bulkUuid,
[$operation],
$bulkDescription,
$this->userContext->getUserId()
);
In this scenario we add 1 operation to a bulk. The moment scheduleBulk
is called, a new record inside the magento_bulk
table is created.
Even with the queues up and running the operations are not created and stay "Pending"
I think the problem relies in the fact that the operation entities are never saved to the database.
Following function of class Magento\AsynchronousOperations\Model\BulkManagement
/**
* Publish list of operations to the corresponding message queues.
*
* @param array $operations
* @return void
*/
private function publishOperations(array $operations)
{
$operationsByTopics = [];
foreach ($operations as $operation) {
+ $this->entityManager->save($operation);
$operationsByTopics[$operation->getTopicName()][] = $operation;
}
foreach ($operationsByTopics as $topicName => $operations) {
$this->publisher->publish($topicName, $operations);
}
}
Adding this line $this->entityManager->save($operation);
in the publicOperations
function, resolves that problem for me.
Expected result (*)
- [Screenshots, logs or description]
- When a bulk is scheduled, the operations are created automatically
Actual result (*)
- [Screenshots, logs or description]
- When a bulk is scheduled, the operations are not created
avoelkl, sanjay-wagento and milindsingh
Metadata
Metadata
Assignees
Labels
Issue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passed