I'm using the 7.x-2.x version of uc_coupon, but I noticed this still exists in 7.x-3.x.
I've come across an issue where the uc_coupon table fields throw an error when I add them to a view. I've defined the view based off of the uc_orders table, and in the fields selection, the Coupon group successfully shows with all fields. But when I add any of those fields to the view, it throws a SQL error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'uc_coupons.order_id' in 'on clause'
After some debugging, I figured out the issue is with the views join definition. where LEFT JOIN {uc_coupons} uc_coupons ON uc_coupons_orders.oid = uc_coupons.order_id
is defined.
I updated the join with the attached patch, and the field showed successfully. I'm wondering how this issue has not arisen previously, or maybe I'm missing something?
Comment | File | Size | Author |
---|---|---|---|
uc_coupon_views_fix.patch | 488 bytes | RayCascella |
Comments
Comment #1
DamienMcKennaThis solves the problem, thank you.