My terms_of_use autocomplete callback was broken as i got error messages like

user warning: Unknown column 'n.language' in 'field list' query: SELECT DISTINCT(n.nid), nr.title FROM node_revisions nr WHERE (n.language ='de' OR n.language ='' OR n.language IS NULL) AND ( LOWER(nr.title) LIKE LOWER('%Nutzungsbedingung%')) LIMIT 0, 10 in /home/sites/swdt/web/sites/all/modules/terms_of_use/terms_of_use.pages.inc on line 16.

I dunno exactly why but it seems the translation system does a rewrite and adds language checks to every query containing something like {node...
This might be a bug since it adds conditions for {node} which don't show up in this query at all.

However joining to {node} wouldn't be wrong at all.. Actually i finally don't understand why you're selecting the node_revision (containing stale revisions) for the title which is present at {node} in the latest revision...

Attached patch corrects the join to {node} which works perfect for us.

CommentFileSizeAuthor
terms_of_use_join.patch626 bytesmiro_dietiker

Comments

miro_dietiker’s picture

Status: Needs review » Closed (duplicate)

duplicate of #412370