Skip to content

Commit

Permalink
Merge pull request #136 from ConductionNL/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
bbrands02 authored Jan 17, 2025
2 parents beee1ea + 9902344 commit 5ca1564
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Service/ObjectService.php
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ private function handleArrayProperty(
return $items;
}

if ($property['items']['type'] !== 'object'
if (isset($property['items']['type']) === true && $property['items']['type'] !== 'object'
&& $property['items']['type'] !== 'file'
) {
return $items;
Expand Down Expand Up @@ -1799,6 +1799,10 @@ public function setDefaults(ObjectEntity $objectEntity): ObjectEntity
$data = $objectEntity->jsonSerialize();
$schema = $this->schemaMapper->find($objectEntity->getSchema());

if ($schema->getProperties() === null) {
return $objectEntity;
}

foreach ($schema->getProperties() as $name=>$property) {
if (isset($data[$name]) === false && isset($property['default']) === true) {
$data[$name] = $this->twig->createTemplate($property['default'], "{$schema->getTitle()}.$name")->render($objectEntity->getObjectArray());
Expand Down

0 comments on commit 5ca1564

Please sign in to comment.