It is not K2, T3 or sh404 sef problem. It is Joomla bug. limit is missing from url's
T3, and K2 are only overriding default JPagination methods and _buildDataObject
method in JPagination class is missing the &limit=$this->limit
. sh404sef is trying to fix it but T3 or K2 override fire before sh404 sef
here is fix for J3x _buildDataObject
/**
* Create and return the pagination data object.
*
* @return object Pagination data object.
*
* @since 1.5
*/
protected function _buildDataObject()
{
$data = new stdClass;
$limitString = '&limit=' . $this->limit; // sh404 fix
// Build the additional URL parameters string.
$params = '';
if (!empty($this->additionalUrlParams))
{
foreach ($this->additionalUrlParams as $key => $value)
{
$params .= '&' . $key . '=' . $value;
}
}
$data->all = new JPaginationObject(JText::_('JLIB_HTML_VIEW_ALL'), $this->prefix);
if (!$this->viewall)
{
$data->all->base = '0';
$data->all->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=');
}
// Set the start and previous data objects.
$data->start = new JPaginationObject(JText::_('JLIB_HTML_START'), $this->prefix);
$data->previous = new JPaginationObject(JText::_('JPREV'), $this->prefix);
if ($this->pagesCurrent > 1)
{
$page = ($this->pagesCurrent - 2) * $this->limit;
// Set the empty for removal from route
// @todo remove code: $page = $page == 0 ? '' : $page;
$data->start->base = '0';
$data->start->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=0');
$data->previous->base = $page;
$data->previous->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $page. $limitString);
}
// Set the next and end data objects.
$data->next = new JPaginationObject(JText::_('JNEXT'), $this->prefix);
$data->end = new JPaginationObject(JText::_('JLIB_HTML_END'), $this->prefix);
if ($this->pagesCurrent < $this->pagesTotal)
{
$next = $this->pagesCurrent * $this->limit;
$end = ($this->pagesTotal - 1) * $this->limit;
$data->next->base = $next;
$data->next->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $next . $limitString);
$data->end->base = $end;
$data->end->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $end . $limitString);
}
$data->pages = array();
$stop = $this->pagesStop;
for ($i = $this->pagesStart; $i <= $stop; $i++)
{
$offset = ($i - 1) * $this->limit;
$data->pages[$i] = new JPaginationObject($i, $this->prefix);
if ($i != $this->pagesCurrent || $this->viewall)
{
$data->pages[$i]->base = $offset;
$data->pages[$i]->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $offset . $limitString);
}
else
{
$data->pages[$i]->active = true;
}
}
return $data;
}
and this one is for 2.5.x
/**
* Create and return the pagination data object.
*
* @return object Pagination data object.
*
* @since 11.1
*/
protected function _buildDataObject()
{
// Initialise variables.
$data = new stdClass;
$limitString = '&limit=' . $this->limit; // sh404 fix
// Build the additional URL parameters string.
$params = '';
if (!empty($this->_additionalUrlParams))
{
foreach ($this->_additionalUrlParams as $key => $value)
{
$params .= '&' . $key . '=' . $value;
}
}
$data->all = new YjsgJPaginationDefaultObject(JText::_('JLIB_HTML_VIEW_ALL'), $this->prefix);
if (!$this->_viewall)
{
$data->all->base = '0';
$data->all->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=');
}
// Set the start and previous data objects.
$data->start = new YjsgJPaginationDefaultObject(JText::_('JLIB_HTML_START'), $this->prefix);
$data->previous = new YjsgJPaginationDefaultObject(JText::_('JPREV'), $this->prefix);
if ($this->get('pages.current') > 1)
{
$page = ($this->get('pages.current') - 2) * $this->limit;
// Set the empty for removal from route
//$page = $page == 0 ? '' : $page;
$data->start->base = '0';
$data->start->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=0');
$data->previous->base = $page;
$data->previous->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $page . $limitString);
}
// Set the next and end data objects.
$data->next = new YjsgJPaginationDefaultObject(JText::_('JNEXT'), $this->prefix);
$data->end = new YjsgJPaginationDefaultObject(JText::_('JLIB_HTML_END'), $this->prefix);
if ($this->get('pages.current') < $this->get('pages.total'))
{
$next = $this->get('pages.current') * $this->limit;
$end = ($this->get('pages.total') - 1) * $this->limit;
$data->next->base = $next;
$data->next->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $next . $limitString);
$data->end->base = $end;
$data->end->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $end . $limitString);
}
$data->pages = array();
$stop = $this->get('pages.stop');
for ($i = $this->get('pages.start'); $i <= $stop; $i++)
{
$offset = ($i - 1) * $this->limit;
// Set the empty for removal from route
//$offset = $offset == 0 ? '' : $offset;
$data->pages[$i] = new YjsgJPaginationDefaultObject($i, $this->prefix);
if ($i != $this->get('pages.current') || $this->_viewall)
{
$data->pages[$i]->base = $offset;
$data->pages[$i]->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $offset . $limitString);
}
}
return $data;
}