Statistic View sorting

Phoca Download - download manager
Bakual
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 14 Aug 2011, 18:56
Contact:

Statistic View sorting

Post 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 :-)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48610
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Statistic View sorting

Post by Jan »

Hi, thank you for this info, I will fix it for the next release.

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48610
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Statistic View sorting

Post by Jan »

Changed in 2.1.4

Jan
If you find Phoca extensions useful, please support the project
Post Reply