Closed (fixed)
Project:
Counter
Version:
6.x-1.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Feb 2009 at 11:20 UTC
Updated:
25 Sep 2009 at 15:04 UTC
This what I get when I visit the report page
Unknown column 'n.language' in 'where clause' query: SELECT COUNT(*) FROM counter WHERE (n.language ='en' OR n.language ='' OR n.language IS NULL) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\...\sites\all\modules\counter\counter.report.inc on line 18.
By the way I didnt update my previous version 6.1.4.
I unistalled it and then installed the new one 6.1.5
The site I have is a multilanguage site with i18n and additional language modules and the error looks like being related to the fact that many languages (6 to be exact) are enabled.
Comments
Comment #1
danielb commentedThis problem comes from line 16
$sql_count = db_rewrite_sql('SELECT COUNT(*) FROM {counter}');This is incorrect use of the function db_rewrite_sql, I believe in this situation, you would not use db_rewrite_sql, or if you wanted to you would do it like this:
$sql_count = db_rewrite_sql('SELECT COUNT(*) FROM {counter}', '{counter}', 'counter_id');But I don't think there is any point.
Normally you would use this function when pulling content from tables such as {blocks}, {comments}, {forum}, {node}, {menu}, {term_data} or {vocabulary}
Basically in situations where translations would be appropriate.
Comment #2
drupalnesia commented@danielb: thanks for your patch, I will applied this on Counter 6.x-2.x version.
To avoid any duplicates then I will fix this bug on this post http://drupal.org/node/335680