From 7c120053d4c6cf90069a1c8c452e160f4681ae3a Mon Sep 17 00:00:00 2001 From: Ruslan Baidan Date: Tue, 26 Nov 2024 19:47:58 +0100 Subject: [PATCH] Fixed setting specific risk for the operational risks during the import. --- .../Processor/OperationalInstanceRiskImportProcessor.php | 3 ++- src/Service/AnrInstanceRiskOpService.php | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Import/Processor/OperationalInstanceRiskImportProcessor.php b/src/Import/Processor/OperationalInstanceRiskImportProcessor.php index eac180c0..d07fe28f 100644 --- a/src/Import/Processor/OperationalInstanceRiskImportProcessor.php +++ b/src/Import/Processor/OperationalInstanceRiskImportProcessor.php @@ -92,7 +92,8 @@ public function processOperationalInstanceRisksData( /** @var Entity\MonarcObject $object */ $object = $instance->getObject(); $operationalInstanceRisk = $this->anrInstanceRiskOpService - ->createInstanceRiskOpObject($instance, $object, $operationalRisk, $operationalInstanceRiskData); + ->createInstanceRiskOpObject($instance, $object, $operationalRisk, $operationalInstanceRiskData) + ->setSpecific($operationalInstanceRiskData['specific'] ?? 0); if ($this->importCacheHelper->getValueFromArrayCache('with_eval')) { $operationalInstanceRisk ->setBrutProb((int)$operationalInstanceRiskData['brutProb']) diff --git a/src/Service/AnrInstanceRiskOpService.php b/src/Service/AnrInstanceRiskOpService.php index 151f0e8e..40c576fd 100644 --- a/src/Service/AnrInstanceRiskOpService.php +++ b/src/Service/AnrInstanceRiskOpService.php @@ -245,9 +245,6 @@ public function createInstanceRiskOpObject( 'riskCacheDescription4' => $rolfRisk->getDescription(4), ] : ['riskCacheDescription' . $anr->getLanguage() => $data['riskCacheDescription']]) ->setCreator($this->connectedUser->getEmail()); - if ($rolfRisk === null) { - $instanceRiskOp->setSpecific(CoreEntity\InstanceRiskOpSuperClass::TYPE_SPECIFIC); - } $this->instanceRiskOpTable->save($instanceRiskOp, false);