diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php b/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php index 22abbb9db9..0fb6e39a2b 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php @@ -911,6 +911,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 7938367526..5c8a7b5771 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); + } }