Page 1 of 1

Statistic View sorting

Posted: 07 Nov 2011, 19:25
by Bakual
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

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);
	}
to the file
/administrator/components/com_phocadownload/models/phocadownloadstat.php
and it should work.
Also you could add a more logic default order to it by using

Code: Select all

parent::populateState('a.hits', 'desc');
in the populateState() function. But one could argue here :-)

Re: Statistic View sorting

Posted: 17 Nov 2011, 19:08
by Jan
Hi, thank you for this info, I will fix it for the next release.

Jan

Re: Statistic View sorting

Posted: 19 Nov 2011, 22:37
by Jan
Changed in 2.1.4

Jan