From c27547fc865daa256a538d64e1a701f5dd7a3ecc Mon Sep 17 00:00:00 2001 From: Michiel Kodde Date: Wed, 20 Mar 2019 09:23:32 +0100 Subject: [PATCH] Apply fix from #185 to other paginate calls 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 --- .../StepupRa/RaBundle/Controller/RaManagementController.php | 4 ++-- .../StepupRa/RaBundle/Controller/SecondFactorController.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Surfnet/StepupRa/RaBundle/Controller/RaManagementController.php b/src/Surfnet/StepupRa/RaBundle/Controller/RaManagementController.php index 5841e4b7..a7e1b612 100644 --- a/src/Surfnet/StepupRa/RaBundle/Controller/RaManagementController.php +++ b/src/Surfnet/StepupRa/RaBundle/Controller/RaManagementController.php @@ -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() ); @@ -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() ); diff --git a/src/Surfnet/StepupRa/RaBundle/Controller/SecondFactorController.php b/src/Surfnet/StepupRa/RaBundle/Controller/SecondFactorController.php index 9606a5c3..ff5ec4e7 100644 --- a/src/Surfnet/StepupRa/RaBundle/Controller/SecondFactorController.php +++ b/src/Surfnet/StepupRa/RaBundle/Controller/SecondFactorController.php @@ -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() );