Fixing the Joomla! 3.3.4 - 3.3.6 pagination bug

in Development on 28 Jan 2015 having 0 comments

An issue recently introduced in Joomla! 3.3.4 (pull request here) makes navigating back to the first page impossible when using SEF. When you click to go to the second page and then attempt to go back to the first page, you'll actually stay on the same page. This is because the "limitstart" parameter is missing from the URL due to this cosmetic change (which attempts to avoid duplicate URLs). They're fixing it in the upcoming 3.3.7 release (pull request here).

Read on for instructions on how to fix this.

Since our extensions are affected as well, the only way to solve this is by modifying the Joomla! core and applying the fix manually (diff here).

The solution is pretty simple:

  • Open your FTP account, connect to your website and go to the libraries/cms/router/ folder. FileZilla is a good FTP client if you're not familiar with them. Your hosting provider should provide you with a username and password to connect to your website's FTP.
  • Create a backup of site.php (download it to your computer) just in case.
  • Edit site.php (on your website) with a text editor. If you don't have one, I strongly suggest you check out Notepad++.
  • Replace:
    if ($this->_mode == JROUTER_MODE_SEF && $route)
    {
        $limitstart = (int) $uri->getVar('limitstart');
    
        if ($limitstart > 0)
        {
            $uri->setVar('start', $limitstart);
        }
    
        $uri->delVar('limitstart');
    }
    
    With:
    if ($this->_mode == JROUTER_MODE_SEF && $route)
    {
        if ($limitstart = $uri->getVar('limitstart'))
        {
            $uri->setVar('start', (int) $limitstart);
            $uri->delVar('limitstart');
        }
    }
    
  • Just save the file - if you're using FileZilla it will automatically prompt you to re-upload the modified file. If not, you'll need to upload it manually.

You'll notice that everything works properly now and you'll be able to change pages without encountering any more issues.



Subscribe to our blog

Found this article interesting? Subscribe to our blog for more.

1000 Characters left