aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Controller/EntryRestController.php
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2017-05-09 09:12:15 +0200
committerGitHub <noreply@github.com>2017-05-09 09:12:15 +0200
commit832fbd94c0e9de98d26cc8a939f1e537b8cb00b8 (patch)
treeb0a743684f44281e1e702b56674dd16ad2424d59 /src/Wallabag/ApiBundle/Controller/EntryRestController.php
parentf2beee5185e0bf7f983fb97a34480b4c74d7eb8c (diff)
parentb60a666df22cb9174bdc4506d71cbc9e8ba6b1c9 (diff)
downloadwallabag-832fbd94c0e9de98d26cc8a939f1e537b8cb00b8.tar.gz
wallabag-832fbd94c0e9de98d26cc8a939f1e537b8cb00b8.tar.zst
wallabag-832fbd94c0e9de98d26cc8a939f1e537b8cb00b8.zip
Merge pull request #3096 from aaa2000/fix-api-entries-pagination-with-perpage
Fix API pagination is broken if perPage is custom value
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller/EntryRestController.php')
-rw-r--r--src/Wallabag/ApiBundle/Controller/EntryRestController.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
index 2c2ec0c1..c544815e 100644
--- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
@@ -98,12 +98,13 @@ class EntryRestController extends WallabagRestController
98 $tags = $request->query->get('tags', ''); 98 $tags = $request->query->get('tags', '');
99 $since = $request->query->get('since', 0); 99 $since = $request->query->get('since', 0);
100 100
101 /** @var \Pagerfanta\Pagerfanta $pager */
101 $pager = $this->getDoctrine() 102 $pager = $this->getDoctrine()
102 ->getRepository('WallabagCoreBundle:Entry') 103 ->getRepository('WallabagCoreBundle:Entry')
103 ->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $sort, $order, $since, $tags); 104 ->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $sort, $order, $since, $tags);
104 105
105 $pager->setCurrentPage($page);
106 $pager->setMaxPerPage($perPage); 106 $pager->setMaxPerPage($perPage);
107 $pager->setCurrentPage($page);
107 108
108 $pagerfantaFactory = new PagerfantaFactory('page', 'perPage'); 109 $pagerfantaFactory = new PagerfantaFactory('page', 'perPage');
109 $paginatedCollection = $pagerfantaFactory->createRepresentation( 110 $paginatedCollection = $pagerfantaFactory->createRepresentation(