From feff307f1f68bff326df49df0f20d90f26c5de64 Mon Sep 17 00:00:00 2001 From: Deepa Gawade Date: Thu, 19 Jan 2023 19:35:45 +0530 Subject: [PATCH] Bug #190387 fix: page limit is not working on notifications list view --- src/com_tjnotifications/admin/models/notifications.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com_tjnotifications/admin/models/notifications.php b/src/com_tjnotifications/admin/models/notifications.php index f5237c1c..8ed0a9b1 100644 --- a/src/com_tjnotifications/admin/models/notifications.php +++ b/src/com_tjnotifications/admin/models/notifications.php @@ -85,11 +85,15 @@ protected function populateState($ordering = 'id', $direction = 'asc') parent::populateState($ordering, $direction); // Get pagination request variables - $limit = $app->getUserStateFromRequest($this->context . '.list.limit', 'limit', $app->get('list_limit'), 'int'); + $limit = (isset($app->input->get('list')['limit'])) ? $app->input->get('list')['limit'] : $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'int'); + $limitstart = $app->input->get('limitstart', 0, 'int'); - // In case limit has been changed, adjust it - $limitstart = ($limit !== 0 ? (floor($limitstart / $limit) * $limit) : 0); + if ($limitstart != 0) + { + // In case limit has been changed, adjust it + $limitstart = ($limit !== 0 ? (floor($limitstart / $limit) * $limit) : 0); + } $this->setState('list.limit', $limit); $this->setState('list.start', $limitstart);