Skip to content

Commit

Permalink
Merge pull request #1608 from ConductionNL/fix/BRK-54/maxDepth
Browse files Browse the repository at this point in the history
Hotfix for BRK too large objects
  • Loading branch information
rjzondervan authored Jan 16, 2024
2 parents ba0d031 + 8906eb2 commit 4b00ecb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/src/Entity/ObjectEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,12 @@ public function toArray(array $configuration = []): array
$config['maxDepth'] = $attribute->getObject()->getMaxDepth() + $config['level'];
}
$config['level'] = $config['level'] + 1;

//TODO: This is a very hacky solution that has to be changed back ASAP
if ($attribute->getObject() === $this->getEntity()) {
$config['maxDepth'] = $config['level'];
}

$objectToArray = $object->toArray($config);

// Check if we want an embedded array
Expand Down

0 comments on commit 4b00ecb

Please sign in to comment.