Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/com_tjnotifications/admin/models/notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deepa-g In $app->input->get('list')['limit'] the $app->input->get('list') should have some default value and the filter or else it will give error if list is not defined same for $app->get('list_limit')


$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);
Expand Down