I am Joomla! extensions developer and one of my users has a Joomla! 2.5 that was upgraded from Joomla! 1.5. After upgrading the user installed my extension (J!Research). For some reason, pagination is broken in this website although it has been widely tested in different server configurations. I have a standard view-model that displays a list of publications and contains some filters. Those filters are implemented using the standard Joomla! style recommendations (available in docs and forums), that is, the filters (drop-down lists) are fields in a form that trigger submission when changed and the values of the form fields are stored in the user state. The populateState method of my model is provided:
Code: Select all
protected function populateState() {
// Initialize variables.
$mainframe = JFactory::getApplication('site');
$params = $mainframe->getParams('com_jresearch');
$this->setState('com_jresearch.publications.filter_search', $mainframe->getUserStateFromRequest($this->_context.'.filter_search', 'filter_search'));
//My publications
$filter_show = $params->get('filter_show', 'all');
$user = JFactory::getUser();
if($filter_show == "my" && !$user->guest)
{
//Only in this case, force the model (ignore the filters)
$member = JTable::getInstance('Member', 'JResearch');
$member->bindFromUsername($user->username);
JRequest::setVar('filter_author', $member->id);
}
$this->setState('com_jresearch.publications.filter_author', $mainframe->getUserStateFromRequest($this->_context.'.filter_author', 'filter_author'));
$this->setState('com_jresearch.publications.filter_year', $mainframe->getUserStateFromRequest($this->_context.'.filter_year', 'filter_year'));
$this->setState('com_jresearch.publications.filter_area', $mainframe->getUserStateFromRequest($this->_context.'.filter_area', 'filter_area'));
$filter_pubtype = $params->get('filter_pubtype', 'all');
if($filter_pubtype != 'all'){
JRequest::setVar('filter_pubtype', $filter_pubtype);
}
$this->setState('com_jresearch.publications.filter_pubtype', $mainframe->getUserStateFromRequest($this->_context.'.filter_pubtype', 'filter_pubtype'));
$this->setState('com_jresearch.publications.filter_team', $mainframe->getUserStateFromRequest($this->_context.'.filter_team', 'filter_team'));
parent::populateState();
}
Has anybody experienced a similar problem before? The site is using PHP 5.2.17, Joomla 2.5.24, cgi-fcgi as the PHP interface with the webserver and Apache/2.4.4. If somebody has an idea or have heard of something like this, I would appreciate to share his experience with me. Thanks for attention and help!
Best,
Luis