Skip to content

Commit

Permalink
IBX-8534: Dropped usage of deprecated contentService::loadContentDraf…
Browse files Browse the repository at this point in the history
…ts method
  • Loading branch information
ViniTou committed Sep 18, 2024
1 parent 9d59dc8 commit c8f0f61
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lib/Server/Controller/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
use Ibexa\Contracts\Core\Repository\RoleService;
use Ibexa\Contracts\Core\Repository\SectionService;
use Ibexa\Contracts\Core\Repository\UserService;
use Ibexa\Contracts\Core\Repository\Values\Content\DraftList\ContentDraftListItemInterface;
use Ibexa\Contracts\Core\Repository\Values\Content\Language;
use Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo;
use Ibexa\Contracts\Core\Repository\Values\User\User as RepositoryUser;
use Ibexa\Contracts\Core\Repository\Values\User\UserGroupRoleAssignment;
use Ibexa\Contracts\Core\Repository\Values\User\UserRoleAssignment;
Expand Down Expand Up @@ -577,11 +579,17 @@ public function loadUserGroupsAssignedToRole($roleId): array
*/
public function loadUserDrafts(int $userId, Request $request): Values\VersionList
{
$contentDrafts = $this->contentService->loadContentDrafts(
$contentDrafts = $this->contentService->loadContentDraftList(
$this->userService->loadUser($userId)
);

return new Values\VersionList($contentDrafts, $request->getPathInfo());
return new Values\VersionList(
array_map(
static fn (ContentDraftListItemInterface $draftListItem): VersionInfo => $draftListItem->getVersionInfo(),

Check failure on line 588 in src/lib/Server/Controller/User.php

View workflow job for this annotation

GitHub Actions / Unit & integration tests (8.3)

Anonymous function should return Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo but returns Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo|null.
$contentDrafts->items
),
$request->getPathInfo()
);
}

/**
Expand Down

0 comments on commit c8f0f61

Please sign in to comment.