Its a warning, not sure how or why, but something to do with weight:
After modifying a product:
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 'weight' at line 12 query: SELECT d.* FROM uc_discounts d LEFT JOIN uc_discounts_products dp ON d.discount_id=dp.discount_id LEFT JOIN uc_discounts_terms dt ON d.discount_id=dt.discount_id LEFT JOIN uc_discounts_skus ds ON d.discount_id=ds.discount_id LEFT JOIN uc_discounts_classes dcl ON d.discount_id=dcl.discount_id WHERE d.requires_code=0 AND (d.has_role_filter=0 OR d.discount_id IN(SELECT dr.discount_id FROM uc_discounts_roles dr, users_roles ur WHERE (dr.role_id=ur.rid AND ur.uid=1) OR dr.role_id=-1 OR dr.role_id=2)) AND (d.filter_type<>1 OR dp.product_id IN(-1,66)) AND (d.filter_type<>2 OR dt.term_id IN(-1,4)) AND (d.filter_type<>3 OR ds.sku IN('','esl-1')) AND (d.has_expiration=0 OR d.expiration>0) ORDER BY d.1255908631 weight in /var/www/vhosts/eventpolicy.com/httpdocs/sites/all/modules/ubercart/contrib/uc_discounts_alt/uc_discounts/uc_discounts.module on line 1641.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | patch-v2.txt | 2.06 KB | noahlively |
| #4 | patch.txt | 109.09 KB | noahlively |
Comments
Comment #1
ezra-g commentedThanks for the bug report. I'm marking this as active, since there is no patch to review here.
Comment #2
noahlively commentedThe bug is in the query defined on line 1626
There are 7 tokens in the sprintf template and 8 actual tokens passed. The missing token should be a 4th "AND (%S)" inside the query template, as follows:
I tested with this change and it works.
Comment #3
ezra-g commentedThanks for pointing this out. Could you file a patch? http://drupal.org/patch
Comment #4
noahlively commentedezra-g,
I've rolled a patch and attached. Unfortunately, it seems that my line indentation is different than what was used in the original file. So you are going to see a lot more changes in the patch than this bug fix.
What IDE did you build this in? Perhaps I can download a copy, re-format the code, and roll another patch.
Thanks,
Noah
Comment #5
noahlively commentedezra-g,
Nevermind.... I was able to adjust Eclipse to indent with spaces rather than tabs. Attached is another patch.
Please note the following changes:
Comment #6
DanielJohnston commentedConfirmed that patch at #5 removes error message.
Comment #7
ezra-g commentedLooks good. Please be sure to mark issues as 'needs review' once you've re-rolled a patch. I missed this patch until just now ;). Committed. Thanks!