From 128833d39cfb0ebd3f274d57657af23518d543c6 Mon Sep 17 00:00:00 2001 From: Robin Guillou Date: Mon, 16 Sep 2019 11:55:53 +0200 Subject: [PATCH] log: fix multi task import logs being mixed up --- .../community/Task/Executor/Model/Task.php | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/app/code/community/Task/Executor/Model/Task.php b/app/code/community/Task/Executor/Model/Task.php index 302a733..a9f1b54 100755 --- a/app/code/community/Task/Executor/Model/Task.php +++ b/app/code/community/Task/Executor/Model/Task.php @@ -271,10 +271,12 @@ public function getStepComment() */ public function setStepMessage($message) { + /** @var string $taskId */ + $taskId = $this->getTaskId(); /** @var int $stepNumber */ $stepNumber = $this->getStepNumber(); /** @var string $messageKey */ - $messageKey = sprintf('message_step_%s', $stepNumber); + $messageKey = sprintf('%s_message_step_%s', $taskId, $stepNumber); /** @var string[] $stepMessage */ $stepMessage = [ 'type' => 'success', @@ -292,10 +294,12 @@ public function setStepMessage($message) */ public function getStepMessage() { + /** @var string $taskId */ + $taskId = $this->getTaskId(); /** @var int $stepNumber */ $stepNumber = $this->getStepNumber(); /** @var string $messageKey */ - $messageKey = sprintf('message_step_%s', $stepNumber); + $messageKey = sprintf('%s_message_step_%s', $taskId, $stepNumber); /** @var string[] $stepMessage */ $stepMessage = [ 'type' => 'success', @@ -320,8 +324,12 @@ public function setStepWarning($message) if (!is_string($message)) { return; } + /** @var string $taskId */ + $taskId = $this->getTaskId(); + /** @var int $stepNumber */ + $stepNumber = $this->getStepNumber(); /** @var string $stepKey */ - $stepKey = sprintf('warning_step_%s', $this->getStepNumber()); + $stepKey = sprintf('%s_warning_step_%s', $taskId, $stepNumber); /** @var mixed[] $warnings */ $warnings = $this->getStepWarnings(); $warnings[] = [ @@ -338,8 +346,12 @@ public function setStepWarning($message) */ public function getStepWarnings() { + /** @var string $taskId */ + $taskId = $this->getTaskId(); + /** @var int $stepNumber */ + $stepNumber = $this->getStepNumber(); /** @var string $stepKey */ - $stepKey = sprintf('warning_step_%s', $this->getStepNumber()); + $stepKey = sprintf('%s_warning_step_%s', $taskId, $stepNumber); /** @var string[] $warnings */ $warnings = []; if (!empty($this->getData($stepKey))) {