Statistic View sorting
Posted: 07 Nov 2011, 19:25
Hi, I've found a small bug on the Statistics view (phocadownloadstat) of the Phoca Download component. If you click on the table header, you can't sort after the title, filename or downloads as expected.
Reason is that you miss the "allowed filter fields" on the constructor of the model.
Add
to the file
Also you could add a more logic default order to it by using in the populateState() function. But one could argue here 
Reason is that you miss the "allowed filter fields" on the constructor of the model.
Add
Code: Select all
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'a.hits',
'a.filename',
'a.title',
);
}
parent::__construct($config);
}
and it should work./administrator/components/com_phocadownload/models/phocadownloadstat.php
Also you could add a more logic default order to it by using
Code: Select all
parent::populateState('a.hits', 'desc');