4 replies [Last post]
sphism's picture
Offline
Bug Finder
Joined: 11/29/2007
Juice: 215

Just tried to setup some class attibutes and got this error:

I added 2 attributes with 3 options in each

Then went to set all the attribute options.

(This was actually the second error message, the first error was similar, then I ran the update script and tried again and got this one)

    * 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 'AND oid = 0' at line 1 query: DELETE FROM dr_uc_class_attribute_options WHERE pcid = AND oid = 0 in /var/www/multisite/drupal/includes/database.mysqli.inc on line 151.
    * user warning: Duplicate entry 'photoprint-1' for key 1 query: INSERT INTO dr_uc_class_attribute_options (pcid, oid, cost, price, weight, ordering) VALUES ('photoprint', 1, 0, 0, 0, 0) in /var/www/multisite/drupal/includes/database.mysqli.inc on line 151.
    * 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 'AND oid = 0' at line 1 query: DELETE FROM dr_uc_class_attribute_options WHERE pcid = AND oid = 0 in /var/www/multisite/drupal/includes/database.mysqli.inc on line 151.
    * user warning: Duplicate entry 'photoprint-2' for key 1 query: INSERT INTO dr_uc_class_attribute_options (pcid, oid, cost, price, weight, ordering) VALUES ('photoprint', 2, 0, 0, 0, 1) in /var/www/multisite/drupal/includes/database.mysqli.inc on line 151.
    * 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 'AND oid = 0' at line 1 query: DELETE FROM dr_uc_class_attribute_options WHERE pcid = AND oid = 0 in /var/www/multisite/drupal/includes/database.mysqli.inc on line 151.
    * user warning: Duplicate entry 'photoprint-3' for key 1 query: INSERT INTO dr_uc_class_attribute_options (pcid, oid, cost, price, weight, ordering) VALUES ('photoprint', 3, 0, 0, 0, 2) in /var/www/multisite/drupal/includes/database.mysqli.inc on line 151.
    * 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 'AND oid = 0' at line 1 query: DELETE FROM dr_uc_class_attribute_options WHERE pcid = AND oid = 0 in /var/www/multisite/drupal/includes/database.mysqli.inc on line 151.
    * user warning: Duplicate entry 'photoprint-4' for key 1 query: INSERT INTO dr_uc_class_attribute_options (pcid, oid, cost, price, weight, ordering) VALUES ('photoprint', 4, 0, 0, 0, 0) in /var/www/multisite/drupal/includes/database.mysqli.inc on line 151.
    * 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 'AND oid = 0' at line 1 query: DELETE FROM dr_uc_class_attribute_options WHERE pcid = AND oid = 0 in /var/www/multisite/drupal/includes/database.mysqli.inc on line 151.
    * user warning: Duplicate entry 'photoprint-5' for key 1 query: INSERT INTO dr_uc_class_attribute_options (pcid, oid, cost, price, weight, ordering) VALUES ('photoprint', 5, 0, 0, 0, 1) in /var/www/multisite/drupal/includes/database.mysqli.inc on line 151.
    * 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 'AND oid = 0' at line 1 query: DELETE FROM dr_uc_class_attribute_options WHERE pcid = AND oid = 0 in /var/www/multisite/drupal/includes/database.mysqli.inc on line 151.
    * user warning: Duplicate entry 'photoprint-6' for key 1 query: INSERT INTO dr_uc_class_attribute_options (pcid, oid, cost, price, weight, ordering) VALUES ('photoprint', 6, 0, 0, 0, 2) in /var/www/multisite/drupal/includes/database.mysqli.inc on line 151.
Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6841
Re: Beta 4 : Classes : Attribute options

I'm pretty sure this has been found before, and it involves a bit of code I forgot to update by beta 4.

Change line 895 of uc_attribute.module to say:

<?php
        db_query
("DELETE FROM $opt_table WHERE $id = $sql_type AND oid = %d", $form_values['id'], $oid);
?>

$type becomes $sql_type.

michels's picture
Offline
Uber DonorBug FinderInternationalizationizer
Joined: 08/12/2007
Juice: 205
Re: Re: Beta 4 : Classes : Attribute options

Works fine after updating line 895.

thanks lyle

sphism's picture
Offline
Bug Finder
Joined: 11/29/2007
Juice: 215
Re: Re: Re: Beta 4 : Classes : Attribute options

Thanks Lyle, will check that fix out later today

Willi.Webels's picture
Offline
Joined: 07/06/2009
Juice: 3
error after order-submit

Hi Lyle,

I think i´ve a problem with my Ubercart 6.x-2.0-rc3 .
When I´ve done an order it will send an email but after this it will show my the order
and on the top of the order I can see following error:
-------------------------------
user warning: Duplicate entry '0' for key 1 query: INSERT INTO uc_webform_productize_data (wid, sid, order_id) VALUES (0, '0', 4) in /is/htdocs/wp1119174_0N2J4KKP7V/www/shop/modules/uc_webform_productize/uc_webform_productize.module on line 292.

Your order is almost complete. Please review the details below and click 'Submit order' if all the information is correct. You may use the 'Back' button to make changes to your order if necessary.
-------------------------------
I´m using Webform Productize 6.x-1.0-alpha1

Is this an error like this "http://www.ubercart.org/forum/bug_reports/2919/beta_4_classes_attribute_options"?
Can you help me?

best regards

Willi ...