Closed (fixed)
Project:
Drupal core
Component:
taxonomy.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
10 Dec 2003 at 01:12 UTC
Updated:
11 Jan 2004 at 00:20 UTC
i'm using a db_prefix in my configuration file (www.mysite.com.php) but see what looks like hard coded term_data in the source ...
$result = db_query("SELECT tid FROM {term_data} WHERE vid = %d", $vid);
here's the error message as well :
http://www.newconnection.org/taxonomy
Comments
Comment #1
killes@www.drop.org commentedIf you specify a db_prefix you need to make sure that your tables are named accordingly.
Ie, your prefix is foo_, then you need a table foo_term_data. The standard Drupal database scheme does not support this.
Comment #2
mandric commentedi edited the project.mysql to add the correct db_prefix but i also have to update the project.module code? or an include file somewhere. the image module (for example) had no problem.
Comment #3
mandric commentedi'm sorry, my last post ended up sounding rather vague, and i couldn't edit it, so here's a repost.
editing the db import files was no problem, i did that. that is also documented fairly well.
so i added the db_prefix manually to all the .mysql files, including project.mysql, before i imported them to the db.
but i shouldn't have to edit project.module or any include files. project.module should be using $db_prefix
from drupal/includes/www.mysite.com.php. I believe the other modules work like this, at least image.module
does.
Comment #4
mandric commentedi believe you didn't understand my bug report, so i set the status to active so you'll see it.
Comment #5
mandric commentedi think term_data hardcoded in taxonomy.module line 725 was breaking things.
[php?
$sql = 'SELECT name FROM term_data WHERE tid IN (%s)';
?]
Comment #6
mandric commentedso i think this is the patch
--- modules/taxonomy.module 24 Dec 2003 15:09:43 -0000 1.88
+++ modules/taxonomy.module 25 Dec 2003 07:14:30 -0000
@@ -736,7 +736,7 @@
break;
default:
// Build title:
- $sql = 'SELECT name FROM term_data WHERE tid IN (%s)';
+ $sql = 'SELECT name FROM {term_data} WHERE tid IN (%s)';
$result = db_query($sql, $taxonomy->str_tids);
while ($term = db_fetch_object($result)) {
$names[] = $term->name;
Comment #7
dries commentedFixed in HEAD. Thanks mio.
Comment #8
(not verified) commented