Closed (fixed)
Project:
Hall of Fame
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Feb 2010 at 16:20 UTC
Updated:
11 Mar 2010 at 23:30 UTC
When I am on /hof/all, every statistic shows up except "Content Published by Type." The heading is there, as is the subheadings (i.e. "for the past week" "for the past month" etc...) but nothing shows up below those headings. I have verified that "Content Published by Type" is checked on admin/settings/hof.
Any ideas?
Comments
Comment #1
DavidWhite commentedWe discovered that this was because of the mix of collations on our site. Some of the tables were in utf8_swedish, not utf8_unicode_ci. See #298820: Illegal mix of collations. The fix is either to fix collations, or to rewrite the query as follows:
$sql = "SELECT DISTINCT n.type, nt.name, count(*) AS quantity, sum(totalcount) AS total_reads FROM {node} n LEFT JOIN {node_type} nt ON n.type=nt.type COLLATE utf8_general_ci LEFT JOIN {node_counter} nc ON (n.nid=nc.nid OR nc.nid IS NULL) WHERE n.status=1 AND n.changed>=%d GROUP BY type ORDER BY type";So this was actually not a bug in the module, but it might happen for other people, so I have reworded the issue title.
Comment #2
syscrusher commentedGreat post, David, and thanks. Do you know of a good way I could code defensively against this problem? Is there a Drupal function to query what collation clause I should use on a given site?
Syscrusher