@@ -961,7 +961,7 @@ private function duplicateRolfRisks(
961
961
foreach ($ sourceRolfRisks as $ sourceRolfRisk ) {
962
962
$ newRolfRisk = (new Entity \RolfRisk ())
963
963
->setAnr ($ newAnr )
964
- ->setCode ($ sourceRolfRisk ->getCode )
964
+ ->setCode ($ sourceRolfRisk ->getCode () )
965
965
->setLabels ($ sourceRolfRisk ->getLabels ())
966
966
->setDescriptions ($ sourceRolfRisk ->getDescriptions ())
967
967
->setCreator ($ this ->connectedUser ->getEmail ());
@@ -1185,7 +1185,7 @@ private function duplicateObjectCategoryAndItsParents(
1185
1185
if ($ sourceObjectCategory ->getParent () !== null
1186
1186
&& !isset ($ objectCategoryOldIdsToNewObjects [$ sourceObjectCategory ->getParent ()->getId ()])
1187
1187
) {
1188
- $ objectCategoryOldIdsToNewObjects = $ this ->duplicateObjectCategoryAndItsParents (
1188
+ $ objectCategoryOldIdsToNewObjects + = $ this ->duplicateObjectCategoryAndItsParents (
1189
1189
$ newAnr ,
1190
1190
$ sourceObjectCategory ->getParent (),
1191
1191
$ objectCategoryOldIdsToNewObjects
@@ -1195,7 +1195,9 @@ private function duplicateObjectCategoryAndItsParents(
1195
1195
$ objectCategoryOldIdsToNewObjects [$ sourceObjectCategory ->getId ()] = $ this ->anrObjectCategoryService ->create (
1196
1196
$ newAnr ,
1197
1197
array_merge ([
1198
- 'parent ' => $ objectCategoryOldIdsToNewObjects [$ sourceObjectCategory ->getParent ()->getId ()] ?? null ,
1198
+ 'parent ' => $ sourceObjectCategory ->getParent () !== null
1199
+ ? $ objectCategoryOldIdsToNewObjects [$ sourceObjectCategory ->getParent ()->getId ()]
1200
+ : null ,
1199
1201
'setOnlyExactPosition ' => true ,
1200
1202
'position ' => $ sourceObjectCategory ->getPosition (),
1201
1203
], $ sourceObjectCategory ->getLabels ()),
@@ -1426,7 +1428,10 @@ private function duplicateInstanceRisks(
1426
1428
if ($ sourceInstanceRisk instanceof Entity \InstanceRisk
1427
1429
&& $ sourceInstanceRisk ->getInstanceRiskOwner () !== null
1428
1430
) {
1431
+ /** @var Entity\Anr $sourceAnr */
1432
+ $ sourceAnr = $ sourceInstance ->getAnr ();
1429
1433
$ newInstanceRisk ->setInstanceRiskOwner ($ this ->instanceRiskOwnerService ->getOrCreateInstanceRiskOwner (
1434
+ $ sourceAnr ,
1430
1435
$ newAnr ,
1431
1436
$ sourceInstanceRisk ->getInstanceRiskOwner ()->getName (),
1432
1437
));
@@ -1463,7 +1468,10 @@ private function duplicateOperationalInstanceRisks(
1463
1468
if ($ sourceInstanceRiskOp instanceof Entity \InstanceRiskOp
1464
1469
&& $ sourceInstanceRiskOp ->getInstanceRiskOwner () !== null
1465
1470
) {
1471
+ /** @var Entity\Anr $sourceAnr */
1472
+ $ sourceAnr = $ sourceInstance ->getAnr ();
1466
1473
$ instanceRiskOwner = $ this ->instanceRiskOwnerService ->getOrCreateInstanceRiskOwner (
1474
+ $ sourceAnr ,
1467
1475
$ newAnr ,
1468
1476
$ sourceInstanceRiskOp ->getInstanceRiskOwner ()->getName (),
1469
1477
);
0 commit comments