Skip to content
Snippets Groups Projects
Commit 8c6ca651 authored by Michael Kessler's avatar Michael Kessler
Browse files

[BUGFIX] Fix pagination for new overview action

parent ec663cf8
No related branches found
No related tags found
1 merge request!43[FEATURE] Enable filtering by all filters
......@@ -222,7 +222,7 @@ class OverviewController extends AbstractController {
// Get all news by category and tag ids
$news = $this->newsRepository->findAllSortedNewsByCategories(
$categoryIds, $newsLimitPerTag, $offset, $sortBy, $tagIds, $startTime, $endTime, $sortDirection
$categoryIds, $newsLimit, $offset, $sortBy, $tagIds, $startTime, $endTime, $sortDirection
);
// Process news result query into meta data
......@@ -244,8 +244,8 @@ class OverviewController extends AbstractController {
$this->highlightBestFitNews($categoryIds, $tagIds);
// Check to achieve less Ajax calls.
$newsCount = $this->newsRepository->newsCountByCategories([], $tagIds, $startTime, $endTime);
$numberOfPages = (int) ($newsLimitPerTag <= 0 ? 0 : ceil($newsCount / $newsLimitPerTag));
$newsCount = $this->newsRepository->newsCountByCategories($categoryIds, $tagIds, $startTime, $endTime);
$numberOfPages = (int) ($newsLimit <= 0 ? 0 : ceil($newsCount / $newsLimit));
if ($numberOfPages !== 0 && $currentPageBrowserPage >= $numberOfPages) {
/** @var ErrorController $errorController */
$errorController = GeneralUtility::makeInstance(ErrorController::class);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment