I keep getting this error immediatly after installing the module.

user warning: 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 /var/www/web192/html/sites/all/modules/counter/counter.module on line 167.

I have german & arabic installed as well and they display the same error with the language code changed accordingly.

Comments

drupalnesia’s picture

Status: Active » Postponed (maintainer needs more info)

I can't reproduce such error. Perhaps some settings in administer-site configuration-languages caused this bug. please try at least 6.x-1.4 and see.

dave reid’s picture

Um...the query is not even using the {node} table. That's why this is failing.

dave reid’s picture

I'm guessing that you're possibly running this query through db_rewrite_sql(). If that's the case and you are not using the {node} table to determine anything in your query, you shouldn't be using db_rewrite_sql() in the code.

dave reid’s picture

Status: Postponed (maintainer needs more info) » Fixed

Confirmed in 6.x-1.2 db_rewrite_sql() was errantly used when the {node} table wasn't even in the SQL. It's not used in the latest versions, so upgrade.

drupalnesia’s picture

@Dave Reid thanks to point me to the bug location, also Danielb provides patch on this post http://drupal.org/node/386634
I will try to reproduce this on a multi-language site, fixed will be applied on 6.x-2.x version.

drupalnesia’s picture

Version: 6.x-1.2 » 6.x-2.0
Status: Fixed » Active

I have test Counter 6.x-2.0 and no error reported, please upgrade to Counter 6.x-.2.0 and report your result here, thanks.

xecstasyx’s picture

i am using counter 6.x-2.0 and im getting kind of the same error at the report page user warning: 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 /var/www/test02/sites/all/modules/counter/counter.report.inc on line 18.

drupalnesia’s picture

@xecstasyx:
This bug confirmed affect in the Multilanguage site, but I need more info to reproduce this error:
--> Tell me any modules you've used for your multi-language site

xecstasyx’s picture

heres the list for multilanguage modules i am using right now, most of them comes with i18n module.

Block translation
Content type translation
Internationalization
Language Icons
Menu translation
Poll aggregate
Profile translation
Registration language
Synchronize translations
Taxonomy translation
Translation helpers
Translation overview
Translation table
Views translation

hope this helps

renat’s picture

Version: 6.x-2.0 » 6.x-2.1

I use Counter 6.x-2.1 and, unfortunately, also faced this problem:
user warning: 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 /home/r/renatbiz/googlokhodcom/public_html/sites/all/modules/counter/counter.report.inc on line 18.

Of course, I also use i18n module (latest available 6.x-1.1). All its components, exept "Views translation", are enabled. Drupal version is 6.14.

drupalnesia’s picture

Status: Active » Needs work

I have found the location of this bug as pointed by "Dave Reid", this bug only happened when i18n module enable.
A bug fixing will available soon.

drupalnesia’s picture

Status: Needs work » Fixed

Bug fix available now!

6.x-2.2:
- New: Show Block/Unblock Users
- New: Redesign "Counter Settings" page
- New: Variable to show how many items per page on Counter Report
- Bug fix: Error on Counter Report when i18n module enable

NOTE: Since "Counter Settings" page was redesigned then you need to clear Drupal cache (Administer - Site Configuration - Performance : Clear Cached Data)

Please test and reporting back. Thanks.

renat’s picture

Thank you very much for your update! The error message vanished now. But, unfortunately, Counter still don't work on my site. In /counter/report I can see only this enscription:

Counter Report
# ID IP Address Created Date Access page

As you can see, there are no data.
And the Counter block shows us:

Counter
* Site Counter: 0
* Unique Visitor: 0
* Registered Users: 22
* Unregistered Users: 4
* Blocked Users: 0
* Published Nodes: 39
* Unpublished Nodes: 0
* Server IP: 77.222.40.91
* Your IP: 91.78.94.70
* Since:

The module do not see any visitors, though Access log and Count content views are enabled. And, for example, Drupal recent hits shows us all information:

10/28/2009 - 17:00 Top pages in the past 8 weeks
admin/reports/pages renat details
10/28/2009 - 17:00 node Anonymous details
10/28/2009 - 16:59 node Anonymous details
10/28/2009 - 16:58 node Anonymous details
10/28/2009 - 16:57 node Anonymous details
10/28/2009 - 16:56 node Anonymous details
10/28/2009 - 16:56 rss.xml Anonymous details
10/28/2009 - 16:56 node Anonymous details
10/28/2009 - 16:55 node Anonymous details
10/28/2009 - 16:54 node Anonymous details
10/28/2009 - 16:53 node Anonymous details
10/28/2009 - 16:52 node Anonymous details
10/28/2009 - 16:51 node Anonymous details
10/28/2009 - 16:51 RSS feed
rss.xml Anonymous details
10/28/2009 - 16:50 node Anonymous details
10/28/2009 - 16:50 node Anonymous details
10/28/2009 - 16:49 node Anonymous details
10/28/2009 - 16:49 Access log settings
admin/reports/settings renat details
10/28/2009 - 16:48 Administer
admin renat details
10/28/2009 - 16:48 node Anonymous details
10/28/2009 - 16:48 Media
press Anonymous details
10/28/2009 - 16:48 Site building
admin/build/sites/default/files ... renat detail

drupalnesia’s picture

Status: Fixed » Needs work

Try to execute http://domainname.tld/update.php and report to us again.

renat’s picture

There were no problems during update, but nothing changed, unfortunately.

drupalnesia’s picture

Please uninstall and install new version, Counter 6.x-2.3 and report the result. Thanks.

renat’s picture

Unfortunately, situation is still the same. There were no problems during Counter 6.x-2.3 installation, but I can see only the same data, as I published in message #13. Anyway, thank you for your work! Maybe I should check something to better understand the origins of this problem?

renat’s picture

Happy New Year to all of you!
I tested new Counter 6.x-2.4 with new Drupal 6.15 and new Internationalisation module, 6.x-1.2. But situation is still the same...

drupalnesia’s picture

Version: 6.x-2.1 » 6.x-2.9
Status: Needs work » Needs review

Hi deymos34:

Look like some variables caused this error. Please try at least 6.x-2.9, I have fix several bugs.
Please test and reported again.

drupalnesia’s picture

Status: Needs review » Closed (fixed)

Drupal will not process any blank result block, so "Show Site Counter result for administer group only" has removed thus this issue automatically fix.