mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-27 11:31:05 +00:00
Page parameter was never used in the function
It could have been used if we set the current page inside PreparePagerForEntries. But we did that in each controller because we can have an OutOfRangeCurrentPageException
This commit is contained in:
parent
2a0eec07a5
commit
53da8ad844
3 changed files with 4 additions and 7 deletions
|
@ -321,8 +321,7 @@ class EntryController extends Controller
|
|||
|
||||
$pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false);
|
||||
|
||||
$entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')
|
||||
->prepare($pagerAdapter, $page);
|
||||
$entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')->prepare($pagerAdapter);
|
||||
|
||||
try {
|
||||
$entries->setCurrentPage($page);
|
||||
|
|
|
@ -125,8 +125,7 @@ class TagController extends Controller
|
|||
|
||||
$pagerAdapter = new ArrayAdapter($entriesByTag);
|
||||
|
||||
$entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')
|
||||
->prepare($pagerAdapter, $page);
|
||||
$entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')->prepare($pagerAdapter);
|
||||
|
||||
try {
|
||||
$entries->setCurrentPage($page);
|
||||
|
|
|
@ -20,16 +20,15 @@ class PreparePagerForEntries
|
|||
|
||||
/**
|
||||
* @param AdapterInterface $adapter
|
||||
* @param int $page
|
||||
*
|
||||
* @return null|Pagerfanta
|
||||
*/
|
||||
public function prepare(AdapterInterface $adapter, $page = 1)
|
||||
public function prepare(AdapterInterface $adapter)
|
||||
{
|
||||
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
||||
|
||||
if (null === $user || !is_object($user)) {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
$entries = new Pagerfanta($adapter);
|
||||
|
|
Loading…
Reference in a new issue