diff --git a/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php b/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php index 9dc9f7cf6..051584f3c 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php @@ -156,12 +156,15 @@ class DocumentPersonController extends AbstractController $this->denyAccessUnlessGranted(PersonVoter::SEE, $person); - $documents = $this->personDocumentACLAwareRepository->findByPerson($person); - - // wrong: count documents in database and retrieve document for this page. $total = $this->personDocumentACLAwareRepository->countByPerson($person); $pagination = $this->paginatorFactory->create($total); + $documents = $this->personDocumentACLAwareRepository->findByPerson( + $person, + [], + $pagination->getItemsPerPage(), + $pagination->getCurrentPageFirstItemNumber()); + $event = new PrivacyEvent($person, [ 'element_class' => PersonDocument::class, 'action' => 'index',