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

savedario - October 15, 2009 - 20:52
Project:Trees
Version:6.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

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".

#1

savedario - October 15, 2009 - 21:17

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

domidc - October 26, 2009 - 08:52

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

 
 

Drupal is a registered trademark of Dries Buytaert.