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

DavidWhite’s picture

Title: hof bytype doesn't display statistics » hof bytype doesn't display statistics when utf8_swedish collation mixed with utf8_unicode_ci (SQL error)
Status: Active » Fixed

We 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.

syscrusher’s picture

Great 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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.