I'm using in a page template this kind of lines:
$result2 = pager_query(db_rewrite_sql("SELECT title, path, mid FROM {menu} WHERE pid = '30' ORDER BY weight ASC"));
In order to do some tricky stuff with the menu that I need to do. Everything was working until I loaded the i18n module. Now I get the error:
user warning: Unknown column 'n.nid' in 'on clause' query: SELECT COUNT(*) FROM menu LEFT JOIN i18n_node i18n ON n.nid = i18n.nid WHERE (i18n.language ='bg' OR i18n.language ='' OR i18n.language IS NULL) AND pid = '30' in /home/yasen/public_html/acm2.com/includes/database.mysql.inc on line 113.
I went through this: http://drupal.org/node/51850 but my version is patched already, in 4.7 the order of the tables in the function "statistics_title_list" is the same as it is in the patch.
What could I do now? If this is not the right way to make queries please someone point me to the right one
Thanks!
Comments
this is only on non-admn
this is only on non-admn pages
when I access any of the pages under /admin/ the menu is diplayed ok and no error is reported.
a dirty hack
I made a very dirty hack - added a line in the beginning of the function "i18n_db_rewrite_sql", containing:
$mode = 'off';
just before the check if($mode == 'off') return;
that way I just get without the function. I don't know what the effect on the internationalization will be, but at least my queries are now working.
If anyone knows how to deal with the problem in a proper way, please tell me :)
undo
well, that was stupid try and I removed the line. still no solution.
db_query
I switched from using pager_query(db_rewrite_sql()) to db_query() and now everythung works