I get the following warnings when I save the configurations after entering a valid node for my Terms of Use:

user warning: Unknown column 'n.language' in 'where clause' query: SELECT nr.title FROM node_revisions nr WHERE (n.language ='en' OR n.language ='' OR n.language IS NULL) AND ( LOWER(nr.title) LIKE LOWER('%39%')) LIMIT 0, 10 in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\sites\all\modules\terms_of_use\terms_of_use.pages.inc on line 15.
user warning: Unknown column 'n.language' in 'where clause' query: SELECT nr.title FROM node_revisions nr WHERE (n.language ='en' OR n.language ='' OR n.language IS NULL) AND ( LOWER(nr.title) LIKE LOWER('%39@link%')) LIMIT 0, 10 in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\sites\all\modules\terms_of_use\terms_of_use.pages.inc on line 15.

I think it has something to do with the node language vs. the administration language.

CommentFileSizeAuthor
#7 terms_of_use_sqlwarning.patch682 byteshefox
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Chill35’s picture

Anyone else seeing this?

prodosh’s picture

I am seeing it too. Happens when you have more than 1 language enabled.

prodosh’s picture

Priority: Normal » Critical
cchamp’s picture

I have the same problem with the search files module.

asak’s picture

Just noticed this myself while installing this modules.

Seems like revisions use no language... that's controlled by the 'node' table in the DB.

BUT - this seems to work even with this warning - the correct node is selected and displayed on registration, and even works with multilingual after adding the variables to i18n as written @ http://drupal.org/node/299416#comment-1577576.

jennifer.chang’s picture

subscribe

hefox’s picture

FileSize
682 bytes

Why is it using node revision? That'll cause multiple titles of the same node when node revisions are used since there's multiple instantaneous of the same node, if the title has been changed.

Current title is stored in the node title to my knowledge, so it's fine to use {node} to my understanding

http://api.drupal.org/api/function/db_rewrite_sql/6

patch done inside terms_of_use directory. Changes node_revision to node and nr to n

miro_dietiker’s picture

Status: Active » Reviewed & tested by the community

posted a duplicate issue on #673002: autocomplete broken in case of translation with same solution.
marking this RTBC.

Kars-T’s picture

Status: Reviewed & tested by the community » Fixed

#418960 by hefox | pban02: Fixed Unknown column 'n.language'.

Changed the line to

$result = db_query_range(db_rewrite_sql("SELECT n.title FROM {node} AS n WHERE n.title LIKE '%%%s%%'"), $string, 0, 10);

because MySQL is not case sensitive by default and the lower steals us performance.

Status: Fixed » Closed (fixed)

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