When accessing

admin/store/settings/uc_discounts/edit

and when using a $db_prefix in drupal's settings.php,

the missing {}'s around "node" result in a missing table sql warning.

lines 226-227 of uc_discounts_alt/uc_discounts/uc_discounts.admin.inc, in uc_discounts_form()

$result = db_query("SELECT n.nid as nid, n.title as title, p.model as model"
. " FROM {uc_products} p INNER JOIN node n ON p.nid=n.nid ORDER BY title");

reviewing the rest of the code, found missing {}'s around "term_node" at

line 811 of uc_discounts_alt/uc_discounts/uc_discounts.module, in get_discounts_for_order()

$result = db_query( "SELECT DISTINCT tid FROM term_node WHERE nid IN(%s)", join(",", $order_product_ids) );

and again at

line 1158 of uc_discounts_alt/uc_discounts/uc_discounts.module, in get_codeless_discounts_for_product()

$result = db_query("SELECT DISTINCT tid FROM term_node WHERE nid=%d", $product_id);

Comments

ryangroe’s picture

That was very sloppy of me. This fix will be part of the beta 7 release I am about to make.

ryangroe’s picture

Status: Active » Needs review

forgot to update status

ezra-g’s picture

Status: Needs review » Fixed

This has been committed, so I'm marking it as fixed ;).

Status: Fixed » Closed (fixed)

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