Commit de7c2768 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#201055 by JirkaRybka, scor: avoid duplicates in stats when page caching is...

#201055 by JirkaRybka, scor: avoid duplicates in stats when page caching is turned on or node title is modified
parent 374a4527
......@@ -42,7 +42,8 @@ function statistics_recent_hits() {
* Menu callback; presents the "top pages" page.
*/
function statistics_top_pages() {
$sql = "SELECT COUNT(path) AS hits, path, title, AVG(timer) AS average_time, SUM(timer) AS total_time FROM {accesslog} GROUP BY path, title";
// MAX(title) avoids having empty node titles which otherwise causes duplicates in the top pages list
$sql = "SELECT COUNT(path) AS hits, path, MAX(title) AS title, AVG(timer) AS average_time, SUM(timer) AS total_time FROM {accesslog} GROUP BY path";
$sql_cnt = "SELECT COUNT(DISTINCT(path)) FROM {accesslog}";
$header = array(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment