after installing drupal 5.5, i18n 5x-2.2 and eCommerce 5.x-3.x (same with 5.x-3.4) i have the following message when i Administer->E-Commerce->Products.

* user warning: Unknown column 'n.nid' in 'on clause' query: SELECT COUNT(*) FROM node as n, ec_product as p LEFT JOIN i18n_node i18n ON n.nid = i18n.nid WHERE (i18n.language ='en' OR i18n.language ='' OR i18n.language IS NULL) AND ( n.vid = p.vid AND n.status = 1 ) in C:\Programme\xampp\htdocs\drupal5\includes\database.mysql.inc on line 172.

* user warning: Unknown column 'n.nid' in 'on clause' query: SELECT n.nid, n.title, p.* FROM node as n, ec_product as p LEFT JOIN i18n_node i18n ON n.nid = i18n.nid WHERE (i18n.language ='en' OR i18n.language ='' OR i18n.language IS NULL) AND ( n.vid = p.vid AND n.status = 1 ) ORDER BY p.nid ASC LIMIT 0, 50 in C:\Programme\xampp\htdocs\drupal5\includes\database.mysql.inc on line 172.

Comments

brmassa’s picture

Status: Active » Fixed

Michael,

its definetively not a eC bug. i believe that i18n module is building a wrong SQL on "FROM node as n, ec_product as p". It should be "FROM node n, ec_product p". The "AS" is only used on fields i think.

regards,

massa

mtraut’s picture

Status: Fixed » Active

Ooops, i am just a newbie with drupal / php, so please don't blame me if i am wrong - but i have to contradict you.

After your reply i dived a little into the databse layer. There you will find the rule that JOINS must be made using SQL JOIN, not "WHERE" conditions. This rule is violated in "product.module" with the result that i18n is not able to extend the node!

There a two "select" statements (line 1120)

$sql = 'SELECT n.nid, n.title, p.* FROM {node} as n, {ec_product} as p WHERE n.vid = p.vid AND n.status = 1'. tablesort_sql($header);

->
$sql = 'SELECT n.nid, n.title, p.* FROM {node} n INNER JOIN {ec_product} p ON n.vid = p.vid WHERE n.status = 1'. tablesort_sql($header);

and (line 1156)

$sql = 'SELECT * FROM {node} n, {ec_product} p WHERE n.vid = p.vid AND n.status = 1'. tablesort_sql($header);

->
$sql = 'SELECT * FROM {node} n INNER JOIN {ec_product} p ON n.vid = p.vid WHERE n.status = 1'. tablesort_sql($header);

WIth these statements fixed, the page is showing correctly.

brmassa’s picture

Status: Active » Fixed

Guysm

fixed on eC4 CVS

regards,

massa

Anonymous’s picture

Status: Fixed » Closed (fixed)

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