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);