PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'uid' in where clause is ambiguous: SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {uc_up_seller_log} s INNER JOIN {uc_orders} o ON sl.oid = o.order_id WHERE (uid = :db_condition_placeholder_0) ) subquery; Array ( [:db_condition_placeholder_0] => 1433 ) in PagerDefault->execute() (line 74 of /home/content/19/10411619/html/includes/pager.inc).

I received this error when clicking on Sales Points from any members account page.

CommentFileSizeAuthor
#1 uc_userpoints_seller.module.tar_.gz2.2 KBNics
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nics’s picture

Assigned: Unassigned » Nics
Issue summary: View changes
FileSize
2.2 KB

Hello,there are some typos in the module, I fixed em with the below patch:

--- ../uc_userpoints_seller.module      2014-05-22 20:27:48.000000000 +0000
+++ ./uc_userpoints_seller.module       2014-05-22 20:28:29.000000000 +0000
@@ -47,9 +47,9 @@
     array('data' => t('Points'), 'field' => 'points'),
   );
   $query = db_select('uc_up_seller_log', 's')->extend('PagerDefault');
-  $query->join('uc_orders', 'o', 'sl.oid = o.order_id');
+  $query->join('uc_orders', 'o', 's.oid = o.order_id');
   $query->fields('o', array('currency'));
-  $query->condition('uid', $usr->uid)
+  $query->condition('s.uid', $usr->uid)
     ->fields('s', array('uid', 'oid', 'points', 'qty', 'model', 'sellprice'))
     ->addExpression('qty * sellprice', 'total_price');
   $results = $query->execute();

Uzy’s picture

It work for me.