OJS Plugin: Statistic Charts (2.4.3 to 2.4.8-1)

@franms, I was with the same problem that @blu3r4w had. The sections Article (Download) and Article(Abstract) didn’t show any data.

I noted that I was getting an error when I tried to access these links. The message was:

DB Error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘dbd_ojs.aset.setting_value’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Stack Trace:

File: /opt/lampp/htdocs/ojs/plugins/generic/statistics/StatisticsChartsDAO.inc.php line 81
Function: DAO->retrieve(“SELECT aset.setting_value, SUM(m.metric) FROM metrics as m INNER…”, Array(4))

File: /opt/lampp/htdocs/ojs/plugins/generic/statistics/StatisticsHandler.inc.php line 198
Function: StatisticsChartsDAO->getMetricsMostPopularByType(“2”, “257”, “2018”, “pt_BR”)

Then, I just added the field “aset.setting_value” to the beginning group by clause, and it is working now. I’m not very used to the group by clause, but I think it is right, isn’t it? If it is, may I send you a pull request? (I’ve never sent one yet :slight_smile: )