From 8906eb2770ffbb4fec9de71d6e1ddab7b1464d46 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Tue, 16 Jan 2024 14:46:20 +0100 Subject: [PATCH] Hotfix for BRK too large objects This hotfix should be reverted ASAP and superceded by a possibility to overrule maxDepth per attribute. --- api/src/Entity/ObjectEntity.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/src/Entity/ObjectEntity.php b/api/src/Entity/ObjectEntity.php index f659dde1a..dc83993f0 100644 --- a/api/src/Entity/ObjectEntity.php +++ b/api/src/Entity/ObjectEntity.php @@ -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