Project:
UbercartCategory:
bug reportPriority:
normalStatus:
fixedIn beta 3, a call to uc_stock_adjust() causes an SQL syntax error. The problem is an over-enthusiastic use of single quotes. The patch to fix the problem follows:
--- uc_stock.module (revision 14)
+++ uc_stock.module (revision 15)
@@ -326,7 +326,7 @@
*/
function uc_stock_adjust($sku, $qty) {
$op = ($qty < 0) ? "-" : "+";
- db_query("UPDATE {uc_product_stock} SET 'stock' = 'stock' $op %d WHERE 'sku' = '%s'", (int) abs($qty), $sku);
+ db_query("UPDATE {uc_product_stock} SET stock = stock $op %d WHERE sku = '%s'", (int) abs($qty), $sku);
}
/**
(the revision numbers refer to our local Subversion repository not the Ubercart Bazaar repository)

Re: uc_stock_adjust() SQL syntax error
Yeah, its amazing how many times I looked at that and saw backticks and not quotes. Fixed & committed.