Skip to content

Commit

Permalink
Fixed iterable as array usage in PagerSearchContentToDataMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Jun 3, 2024
1 parent 3618ca9 commit 136d2d1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib/Mapper/PagerSearchContentToDataMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,11 @@ protected function getContributor(ContentInfo $contentInfo): ?User
protected function setTranslatedContentTypesNames(array &$data, array $contentTypeIds): void
{
// load list of content types with proper translated names
$contentTypes = $this->contentTypeService->loadContentTypeList(
array_unique($contentTypeIds),
$this->userLanguagePreferenceProvider->getPreferredLanguages()
$contentTypes = iterator_to_array(
$this->contentTypeService->loadContentTypeList(
array_unique($contentTypeIds),
$this->userLanguagePreferenceProvider->getPreferredLanguages()
)
);

foreach ($data as $idx => $item) {
Expand Down

0 comments on commit 136d2d1

Please sign in to comment.