1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

Fix API pagination is broken if perPage is custom value

Fix #2720
This commit is contained in:
adev 2017-05-08 16:27:16 +02:00
parent f2beee5185
commit b60a666df2
2 changed files with 18 additions and 1 deletions

View file

@ -98,12 +98,13 @@ class EntryRestController extends WallabagRestController
$tags = $request->query->get('tags', '');
$since = $request->query->get('since', 0);
/** @var \Pagerfanta\Pagerfanta $pager */
$pager = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Entry')
->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $sort, $order, $since, $tags);
$pager->setCurrentPage($page);
$pager->setMaxPerPage($perPage);
$pager->setCurrentPage($page);
$pagerfantaFactory = new PagerfantaFactory('page', 'perPage');
$paginatedCollection = $pagerfantaFactory->createRepresentation(