aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/EntryController.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-04-12 16:04:17 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2016-04-12 16:04:17 +0200
commit624a7c6df1142048cc73770e2c7b7377acd30a9e (patch)
tree005759ecb04a9d4e41e06a932d67cb295c307159 /src/Wallabag/CoreBundle/Controller/EntryController.php
parent80bd17f00df7691086a47632cefff4ad0e670a44 (diff)
downloadwallabag-624a7c6df1142048cc73770e2c7b7377acd30a9e.tar.gz
wallabag-624a7c6df1142048cc73770e2c7b7377acd30a9e.tar.zst
wallabag-624a7c6df1142048cc73770e2c7b7377acd30a9e.zip
Improve pagination when user has lot of entries
Fix #1905 * Usage of whiteoctober/WhiteOctoberPagerfantaBundle
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/EntryController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index cba58858..e6077707 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -3,7 +3,6 @@
3namespace Wallabag\CoreBundle\Controller; 3namespace Wallabag\CoreBundle\Controller;
4 4
5use Pagerfanta\Adapter\DoctrineORMAdapter; 5use Pagerfanta\Adapter\DoctrineORMAdapter;
6use Pagerfanta\Exception\OutOfRangeCurrentPageException;
7use Pagerfanta\Pagerfanta; 6use Pagerfanta\Pagerfanta;
8use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 7use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
9use Symfony\Bundle\FrameworkBundle\Controller\Controller; 8use Symfony\Bundle\FrameworkBundle\Controller\Controller;
@@ -253,13 +252,7 @@ class EntryController extends Controller
253 $entries = new Pagerfanta($pagerAdapter); 252 $entries = new Pagerfanta($pagerAdapter);
254 253
255 $entries->setMaxPerPage($this->getUser()->getConfig()->getItemsPerPage()); 254 $entries->setMaxPerPage($this->getUser()->getConfig()->getItemsPerPage());
256 try { 255 $entries->setCurrentPage($page);
257 $entries->setCurrentPage($page);
258 } catch (OutOfRangeCurrentPageException $e) {
259 if ($page > 1) {
260 return $this->redirect($this->generateUrl($type, array('page' => $entries->getNbPages())), 302);
261 }
262 }
263 256
264 return $this->render( 257 return $this->render(
265 'WallabagCoreBundle:Entry:entries.html.twig', 258 'WallabagCoreBundle:Entry:entries.html.twig',