From 8389db28d1030acf36b040a047bf5e768cb298f6 Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Fri, 17 Jan 2025 11:39:34 +0100 Subject: [PATCH 1/2] Some fixes --- lib/Service/ObjectService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Service/ObjectService.php b/lib/Service/ObjectService.php index 08655db..f90ff2c 100755 --- a/lib/Service/ObjectService.php +++ b/lib/Service/ObjectService.php @@ -725,7 +725,7 @@ private function addObject( // Handle nested object in array $nestedObject = $this->saveObject( register: $register, - schema: $subSchema, + schema: (int) $subSchema, object: $item, depth: $depth-1 ); @@ -834,7 +834,7 @@ private function handleArrayProperty( return $items; } - if ($property['items']['type'] === 'file') { + if (isset($property['items']['type']) === true && $property['items']['type'] === 'file') { foreach ($items as $index => $item) { $items[$index] = $this->handleFileProperty( objectEntity: $objectEntity, From 73863f53cf0ab5f009203b3cca1ca1b84194d803 Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Fri, 17 Jan 2025 11:42:27 +0100 Subject: [PATCH 2/2] Another error prevented --- lib/Service/ObjectService.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Service/ObjectService.php b/lib/Service/ObjectService.php index f90ff2c..986a46c 100755 --- a/lib/Service/ObjectService.php +++ b/lib/Service/ObjectService.php @@ -972,6 +972,10 @@ private function handleProperty( int $depth = 0 ): array { + if (isset($property['type']) === false) { + return $object; + } + switch($property['type']) { case 'object': $object[$propertyName] = $this->handleObjectProperty(