Bug usign drupal with table prefixs

Project:Ubercart Color Attribute
Component:Code
Category:bug report
Priority:normal
Assigned:luketarplin
Status:fixed
Description
Project: 
Ubercart

Hello, I trie the uc_color_attirbute and I found some bug. My problem was that I'm using "dp_" as prefix of my drupal's tables and uc_color_attribute module doesn't use this.

So i made some changes in some files to solve this:
-- uc_color_attribute.install
7c7
My version: < db_query("create table {uc_color_attribute}( `aid` int(10) UNSIGNED NOT NULL , `oid` int(10) NOT NULL , `hexValue` varchar(7) NOT NULL , PRIMARY KEY (`oid`));");
Web version: > db_query("create table `uc_color_attribute`( `aid` int(10) UNSIGNED NOT NULL , `oid` int(10) NOT NULL , `hexValue` varchar(7) NOT NULL , PRIMARY KEY (`oid`));");

--uc_color_attribute.module
16c16
My version: < $check = db_result(db_query("select hexValue from {uc_color_attribute} where oid = %d limit 1;", check_plain($arg5)));
Web version: > $check = db_result(db_query("select hexValue from uc_color_attribute where oid = %d limit 1;", check_plain($arg5)));
74d73
My version: < $lastId = db_fetch_object(db_query("show table status like 'dp_uc_attribute_options';"));
Web version: > $lastId = db_fetch_object(db_query("show table status like 'uc_attribute_options';"));

The last one should say something like:
< $lastId = db_fetch_object(db_query("show table status like {uc_attribute_options};"));
But it doesn't work, I don't know why.

That's all.

Matías.

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 187
#1
Assigned to:Guest» luketarplin
Status:active» fixed

I have ensured all db queries have a {} wrapper around the tables, which should work with drupal's table prefixing.

AttachmentSize
uc_color_attribute.tar 10 KB