diff --git a/src/lib/Persistence/Legacy/Content/Handler.php b/src/lib/Persistence/Legacy/Content/Handler.php index d28c53f31e..1165fcb9e8 100644 --- a/src/lib/Persistence/Legacy/Content/Handler.php +++ b/src/lib/Persistence/Legacy/Content/Handler.php @@ -922,6 +922,11 @@ static function ($lang) use ($languageCode) { public function loadVersionInfoList(array $contentIds): array { $rows = $this->contentGateway->loadVersionInfoList($contentIds); + + if (empty($rows)) { + return []; + } + $mappedRows = array_map( static function (array $row): array { return [ diff --git a/tests/integration/Core/Repository/ContentService/LoadVersionInfoTest.php b/tests/integration/Core/Repository/ContentService/LoadVersionInfoTest.php index a03e7370b2..026d6f0e08 100644 --- a/tests/integration/Core/Repository/ContentService/LoadVersionInfoTest.php +++ b/tests/integration/Core/Repository/ContentService/LoadVersionInfoTest.php @@ -42,4 +42,18 @@ public function testLoadVersionInfoListByContentInfo(): void self::assertEquals($loadedVersionInfo, $versionInfo); } } + + public function testLoadVersionInfoListByContentInfoForTopLevelNode(): void + { + $contentService = self::getContentService(); + $locationService = self::getLocationService(); + + $location = $locationService->loadLocation(1); + + $versionInfoList = $contentService->loadVersionInfoListByContentInfo( + [$location->getContentInfo()] + ); + + self::assertCount(0, $versionInfoList); + } }