Skip to content

Commit

Permalink
Apply fix from #185 to other paginate calls
Browse files Browse the repository at this point in the history
Other controller actions use the paginator to paginate their results,
sorting was broken in certain situations.

This was fixed for the token overview in #185, but not fixed for the
other paginator usages.

This should fix the `UnexpectedTypeException` 'PropertyAccessor requires
a graph of objects or arrays to operate on error

See: https://www.pivotaltracker.com/story/show/164729675
  • Loading branch information
MKodde committed Mar 20, 2019
1 parent cf65991 commit c27547f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function manageAction(Request $request)
$raList = $service->search($searchQuery);

$pagination = $this->getPaginator()->paginate(
$raList->getTotalItems() > 0 ? array_fill(0, $raList->getTotalItems(), 1) : [],
$raList->getTotalItems() > 0 ? $raList->getElements() : [],
$raList->getCurrentPage(),
$raList->getItemsPerPage()
);
Expand Down Expand Up @@ -109,7 +109,7 @@ public function raCandidateSearchAction(Request $request)
$raCandidateList = $service->search($command);

$pagination = $this->getPaginator()->paginate(
$raCandidateList->getTotalItems() > 0 ? array_fill(4, $raCandidateList->getTotalItems(), 1) : [],
$raCandidateList->getTotalItems() > 0 ? $raCandidateList->getElements() : [],
$raCandidateList->getCurrentPage(),
$raCandidateList->getItemsPerPage()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function auditLogAction(Request $request)
$auditLog = $this->getAuditLogService()->getAuditlog($command);

$pagination = $this->get('knp_paginator')->paginate(
$auditLog->getTotalItems() > 0 ? array_fill(0, $auditLog->getTotalItems(), 1) : [],
$auditLog->getTotalItems() > 0 ? $auditLog->getElements() : [],
$auditLog->getCurrentPage(),
$auditLog->getItemsPerPage()
);
Expand Down

0 comments on commit c27547f

Please sign in to comment.