tikiwiki/stats does not work, and displays "An error occurred while performing the request."
However, I would expect, that it displays the statistics.
I use tikiwiki 16.2, mysqld is 5.7.17-0ubuntu0.16.04.1
It seems that the error happens in function site_stats() from lib/stats/statslib.php.
I uncommented every call to functions, in tiki-stats.php, to find the position with the error.
It seems that some sql statements are wrong, and only work with some relax settings.
mysql 5.7.17 uses sql_mode=only_full_group_by .
I took the select-Statement from line 235 and inserted it into mysql.
select SUM(`pageviews`) AS views, `day` AS unixtime FROM `tiki_pageviews` GROUP by FROM_UNIXTIME(`day`, '%Y-No value assignedd') ORDER by views DESC LIMIT 1;
ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'tikiwikitestdb.tiki_pageviews.day' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
We group by date. However there are many seconds matching the same day.
So SQL does not know which unixtime to return.
select SUM(`pageviews`) AS views, ANY_VALUE(`day`) AS unixtime FROM `tiki_pageviews` GROUP by FROM_UNIXTIME(`day`, '%Y-No value assignedd') ORDER by views DESC LIMIT 1;
The solution is to tell sql that it should accept any_value().
select SUM(`pageviews`) AS views, ANY_VALUE(`day`) AS unixtime FROM `tiki_pageviews` GROUP by FROM_UNIXTIME(`day`, '%Y-No value assignedd') ORDER by views DESC LIMIT 1;
statslib.php:234 to 260 $max = $this->fetchAll( "SELECT SUM(`pageviews`) AS views, ANY_VALUE(`day`) AS unixtime" . " FROM `tiki_pageviews`" . " GROUP BY FROM_UNIXTIME(`day`, '%Y-%m-%d')" . " ORDER BY views DESC" . " LIMIT 1" ); $maxvar = $max[0]['views']; //get min pageview number $min = $this->fetchAll( "SELECT SUM(`pageviews`) AS views, ANY_VALUE(`day`) AS unixtime" . " FROM `tiki_pageviews`" . " GROUP BY FROM_UNIXTIME(`day`, '%Y-%m-%d')" . " ORDER BY views ASC" . " LIMIT 1" ); $minvar = $min[0]['views']; //pull all dates with max or min because there may be more than one for each $views = $this->fetchAll( "SELECT SUM(`pageviews`) AS views, FROM_UNIXTIME(`day`, '%Y-%m-%d') AS date, ANY_VALUE(`day`) AS unixtime" . " FROM `tiki_pageviews`" . " GROUP BY FROM_UNIXTIME(`day`, '%Y-%m-%d')" . " HAVING views = '$maxvar' OR views = '$minvar'" . " ORDER BY date ASC" );
To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tiki.org instance. To start, simply select a version and click on "Create show2.tiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tiki.org.
To help developers solve the bug, we kindly request that you demonstrate your bug on a show.tikiwiki.org instance. To start, simply select a version and click on "Create show.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show.tikiwiki.org.
filename | created | hits | comment | version | filetype | ||
---|---|---|---|---|---|---|---|
No attachments for this item |