Skip to content

Commit dc2ebaf

Browse files
committed
fix api results empty ola_level_ttr should be null, not an empty array
1 parent a8460a3 commit dc2ebaf

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Glpi/Api/HL/Search.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,10 @@ public static function getSearchResultsBySchema(array $schema, array $request_pa
887887
}
888888
}
889889
foreach ($mapped_objs as $path => $data) {
890+
if ($data === null) {
891+
ArrayPathAccessor::setElementByArrayPath($result, $path, null);
892+
continue;
893+
}
890894
$existing_data = ArrayPathAccessor::getElementByArrayPath($result, $path) ?? [];
891895
/** @noinspection SlowArrayOperationsInLoopInspection */
892896
$data = array_merge($existing_data, $data);

0 commit comments

Comments
 (0)