Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions lib/Service/SynchronizationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,12 @@ private function synchronizeExternToIntern(
$stageStartTime = microtime(true);
$result['objects']['found'] = count($objectList);

if ($sourceConfig['resultsPosition'] === '_object') {
$objectList = [$objectList];
$result['objects']['found'] = count($objectList);
}
if ($sourceConfig['resultsPosition'] === '_object') {
if (array_is_list($objectList) === false) {
$objectList = [$objectList];
}
$result['objects']['found'] = count($objectList);
}

$result['timing']['stages']['object_preparation'] = [
'duration_ms' => round((microtime(true) - $stageStartTime) * 1000, 2),
Expand Down Expand Up @@ -1942,9 +1944,9 @@ public function getAllObjectsFromApi(Synchronization $synchronization, ?bool $is
usesPagination: $usesPagination
);

if (array_is_list($objects) === false) {
$objects = [$objects];
}
if ($sourceConfig['resultsPosition'] !== '_object' && array_is_list($objects) === false) {
$objects = [$objects];
}

// Merge additional data into each object if $data is provided
if ($data !== null
Expand Down
Loading