Skip to content

Commit

Permalink
EZP-31026: Fixed resolving of lang params in SA loadContentListByCont…
Browse files Browse the repository at this point in the history
…entInfo (#2816)

Fixed resolving of language parameters in the `SiteAccessAware\ContentService::loadContentListByContentInfo` method.
  • Loading branch information
adamwojs authored Oct 11, 2019
1 parent 40a840a commit 50d956c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions eZ/Publish/Core/Repository/SiteAccessAware/ContentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,13 @@ public function deleteTranslationFromDraft(VersionInfo $versionInfo, $languageCo
return $this->service->deleteTranslationFromDraft($versionInfo, $languageCode);
}

public function loadContentListByContentInfo(array $contentInfoList, array $languages = [], $useAlwaysAvailable = true)
public function loadContentListByContentInfo(array $contentInfoList, array $languages = null, $useAlwaysAvailable = null)
{
return $this->service->loadContentListByContentInfo($contentInfoList, $languages, $useAlwaysAvailable);
return $this->service->loadContentListByContentInfo(
$contentInfoList,
$this->languageResolver->getPrioritizedLanguages($languages),
$this->languageResolver->getUseAlwaysAvailable($useAlwaysAvailable)
);
}

public function hideContent(ContentInfo $contentInfo): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ public function providerForLanguagesLookupMethods()

['loadContentByRemoteId', ['f348tj4gorgji4'], true, 1],
['loadContentByRemoteId', ['f348tj4gorgji4', self::LANG_ARG, 4, false], true, 1],

['loadContentListByContentInfo', [[$contentInfo]], [], 1],
['loadContentListByContentInfo', [[$contentInfo], self::LANG_ARG, false], [], 1],
];
}
}

0 comments on commit 50d956c

Please sign in to comment.