31
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-06-02 05:30:48 +00:00

Call to undefined method

This commit is contained in:
Michael Babker 2014-10-17 12:58:13 -04:00
parent d7b7915b22
commit faa490e1c1

View File

@ -151,10 +151,13 @@ class DisplayController extends \JControllerBase
// Check if the ordering field is in the white list, otherwise use the incoming value.
$value = $this->getApplication()->getUserStateFromRequest($this->context . '.ordercol', 'filter_order', $this->defaultOrderColumn);
if (!in_array($value, $model->getSortFields()))
if (method_exists($model, 'getSortFields'))
{
$value = $this->defaultOrderColumn;
$this->getApplication()->setUserState($this->context . '.ordercol', $value);
if (!in_array($value, $model->getSortFields()))
{
$value = $this->defaultOrderColumn;
$this->getApplication()->setUserState($this->context . '.ordercol', $value);
}
}
$state->set('list.ordering', $value);