Skip to content

Commit

Permalink
Merge pull request #66 from monarc-project/patch-object-display
Browse files Browse the repository at this point in the history
Fixed the error of the object disappearing. and removal of specific information risk.
  • Loading branch information
ruslanbaidan authored Nov 30, 2023
2 parents 0ee7793 + 470cf1d commit 47ced3e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Service/ObjectService.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,15 @@ public function getCompleteEntity($id, $anrContext = MonarcObject::CONTEXT_BDC,
// Retrieve parent recursively
if ($anrContext == MonarcObject::CONTEXT_ANR) {
//Check if the object is linked to the $anr
$found = false;
$anrObject = null;
foreach ($object->getAnrs() as $a) {
if ($a->getId() === $anr) {
$found = true;
$anrObject = $a;
break;
$found = $object->getAnr() !== null;
$anrObject = $object->getAnr();
if ($anrObject === null) {
foreach ($object->getAnrs() as $a) {
if ($a->getId() === $anr) {
$found = true;
$anrObject = $a;
break;
}
}
}

Expand Down

0 comments on commit 47ced3e

Please sign in to comment.