Download & Extend

AT least one SQL statement does not work when using table name prefix

Project:Trees
Version:6.x-1.1
Component:Code
Category:task
Priority:normal
Assigned:domidc
Status:active

Issue Summary

tress.module code: 823

  $result = db_result(db_query("SELECT m.mlid FROM menu_links m INNER JOIN trees t ON t.mlid = m.mlid WHERE m.plid = %d AND m.link_path = '%s' AND m.module = '%s'", 0, arg(0).'/'.arg(1), 'trees'));
should be instead:
  $result = db_result(db_query("SELECT m.mlid FROM {menu_links} m INNER JOIN {trees} t ON t.mlid = m.mlid WHERE m.plid = %d AND m.link_path = '%s' AND m.module = '%s'", 0, arg(0).'/'.arg(1), 'trees'));

otherwise one gets "Table not found".

Comments

#1

I've found a second one in:

trees.pages.inc: 180

$menu_name = db_query("SELECT menu_name FROM menu_links WHERE mlid = %d", $tree['mlid']);

should be instead:
$menu_name = db_query("SELECT menu_name FROM {menu_links} WHERE mlid = %d", $tree['mlid']);

#2

We be fixed as soon as possible, tonight I ll release a version with these fixes

#3

Category:bug report» task

#4

Assigned to:Anonymous» domidc
nobody click here