- last update
10 months ago 7 pass, 1 fail
We need to use entity_pager with a paginated view.
It might be an edge use case, but we basically need to have prev/next links only for a given page of the view (links should stop when reaching the end of the current page).
To do this, we call EntityPagerFactory::get()
manually on our paginated view.
Everything works correctly, except the count which does not handle the offset correctly.
Create a view with 100 results, which displays 50 results per page.
Build a block with this code:
Views::getView('foo');
$view->setCurrentPage(1);
$links = $this->pagerFactory->get($view, ['relationship' => []])->getLinks();
Display it on the third node of the page.
The count is "3 of 100" instead of "53 of 100".
EntityPager::getCount()
should add the offset to the count.
Needs work
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.