While activating one of Ubercart modules, I got a mysql error message in some insert query. With a little search, I found that the hole module (especially in the .install files), doesn't use the db_query() function as it should.
For example, in uc_order/uc_order.install, the line
db_query("INSERT INTO {uc_order_statuses} (order_status_id, title, state, weight, locked) VALUES ('pending', '". $t('Pending') ."', 'post_checkout', 0, 1);");
should be :
db_query("INSERT INTO {uc_order_statuses} (order_status_id, title, state, weight, locked) VALUES ('pending', '%s', 'post_checkout', 0, 1);", $t('Pending'));
to format the strings correctly. (In my case, it was a simple quote in the translated string, which led to the query error message I got).

I hope it will be fixed in the next versions for the module.

Comments

rszrama’s picture

Status: Active » Fixed

Silly mistake. Thanks for reporting. The best I can figure we did this b/c of the limitations of update_sql() in the same .install files. I fixed this for the PayPal module as well.

Status: Fixed » Closed (fixed)
Issue tags: -SQL queries

Automatically closed -- issue fixed for 2 weeks with no activity.