From 95153b5bbb4ae073de0831606e052ce268d6aa3c Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 30 Apr 2020 21:12:13 +0200 Subject: [PATCH] fix pagination --- Admin/Install/Navigation.install.json | 8 ++++---- Controller/BackendController.php | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 1662e90..487d282 100644 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -5,7 +5,7 @@ "type": 2, "subtype": 1, "name": "News", - "uri": "{/prefix}news/dashboard?{?}", + "uri": "{/prefix}news/dashboard?u={?u}", "target": "self", "icon": null, "order": 40, @@ -19,7 +19,7 @@ "type": 3, "subtype": 1, "name": "News", - "uri": "{/prefix}news/dashboard?{?}", + "uri": "{/prefix}news/dashboard?u={?u}", "target": "self", "icon": null, "order": 1, @@ -34,7 +34,7 @@ "type": 3, "subtype": 1, "name": "Archive", - "uri": "{/prefix}news/archive?{?}", + "uri": "{/prefix}news/archive?u={?u}", "target": "self", "icon": null, "order": 5, @@ -64,7 +64,7 @@ "type": 3, "subtype": 1, "name": "Draft", - "uri": "{/prefix}news/draft/list", + "uri": "{/prefix}news/draft/list?u={?u}", "target": "self", "icon": null, "order": 15, diff --git a/Controller/BackendController.php b/Controller/BackendController.php index f07d268..b87a0f7 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -59,11 +59,16 @@ final class BackendController extends Controller implements DashboardElementInte NewsArticleMapper::withConditional('language', $response->getHeader()->getL11n()->getLanguage()) ::getBeforePivot((int) ($request->getData('id') ?? 0), null, 25) ); - } else { + } elseif ($request->getData('ptype') === '-') { $view->setData('news', NewsArticleMapper::withConditional('language', $response->getHeader()->getL11n()->getLanguage()) ::getAfterPivot((int) ($request->getData('id') ?? 0), null, 25) ); + } else { + $view->setData('news', + NewsArticleMapper::withConditional('language', $response->getHeader()->getL11n()->getLanguage()) + ::getAfterPivot(0, null, 25) + ); } return $view;