| Project: | Ubercart Contributions |
| Component: | Code |
| Category: | |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Project:
Ubercart In 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)
