Project:
UbercartCategory:
bug reportPriority:
normalStatus:
fixedLoaded Beta 3 on a development machine, and this is what I get when I goto apply the attributes
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE = AND aid = 1' at line 1 query: DELETE FROM WHERE = AND aid = 1 in C:\websites\mysite.com\includes\database.mysql.inc on line 172.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(, aid, ordering, required, default_option) VALUES (, 1, 1, 0, 0)' at line 1 query: INSERT INTO (, aid, ordering, required, default_option) VALUES (, 1, 1, 0, 0) in C:\websites\mysite.com\includes\database.mysql.inc on line 172.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE = AND oid = 1' at line 1 query: DELETE FROM WHERE = AND oid = 1 in C:\websites\mysite.com\includes\database.mysql.inc on line 172.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(, oid, cost, price, weight, ordering) VALUES (, 1, 1, 0, 0, 0)' at line 1 query: INSERT INTO (, oid, cost, price, weight, ordering) VALUES (, 1, 1, 0, 0, 0) in C:\websites\mysite.com\includes\database.mysql.inc on line 172.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE = AND oid = 1' at line 1 query: DELETE FROM WHERE = AND oid = 1 in C:\websites\mysite.com\includes\database.mysql.inc on line 172.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(, oid, cost, price, weight, ordering) VALUES (, 1, 2, 0, 0, 0)' at line 1 query: INSERT INTO (, oid, cost, price, weight, ordering) VALUES (, 1, 2, 0, 0, 0) in C:\websites\mysite.com\includes\database.mysql.inc on line 172.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE = AND oid = 1' at line 1 query: DELETE FROM WHERE = AND oid = 1 in C:\websites\mysite.com\includes\database.mysql.inc on line 172.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(, oid, cost, price, weight, ordering) VALUES (, 1, 3, 0, 0, 0)' at line 1 query: INSERT INTO (, oid, cost, price, weight, ordering) VALUES (, 1, 3, 0, 0, 0) in C:\websites\mysite.com\includes\database.mysql.inc on line 172.what I have found so far is that the $form_values['type'] is returning %d instead of product, currently my fix is listed below but as I know that is not the correct way I am going to keep working on this.
if ($form_values['type'] == 'product' || $form_values['type'] == '%d'){
ps: sorry about the messy post in the bug reports section



Re: Selecting Attribute Options Beta 3
As promised the clean fix (all in the uc_attribute.module file)
added in line 726
$formtype = 'product';
added in line 735
$formtype = 'class';
line 803
was $form['type'] = array('#type' => 'value', '#value' => $type);
should be $form['type'] = array('#type' => 'value', '#value' => $formtype);
to sum up what was happening
The script receives the $type variable and it needs to be passed out to other stuff via a form item, but we change the $type var to hold %d or %s for the db queries so i added a variable to keep is the same and carry it all the way to the bottom.
Re: Re: Selecting Attribute Options Beta 3
Thanks for pointing this out. Obviously I didn't test well enough when I added attributes to classes.
Fixed.
Re: Re: Selecting Attribute Options Beta 3
Great fix thanks