Postgres error when adding userpoints feature to product

rukaya - October 6, 2009 - 12:34
Project:Ubercart Userpoints
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hello

I got the following error when trying to add 10 userpoints to a product as a feature :

* warning: pg_query() [function.pg-query]: Query failed: ERROR: operator does not exist: character varying = integer LINE 1: ...lect pfid from uc_product_features where nid = 4 and fid = 0 ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. in database.pgsql.inc on line 139.
* user warning: query: select pfid from uc_product_features where nid = 4 and fid = 0 in uc_userpoints_product.module on line 120.

I've changed line 120 from :

$pf = db_fetch_object(db_query("select pfid from {uc_product_features} where nid = %d and fid = %d",$data['nid'],$data['fid']));

to :

$pf = db_fetch_object(db_query("select pfid from {uc_product_features} where nid = %d and fid = '%s'",$data['nid'],$data['fid']));

And that works. Just to let you know.

 
 

Drupal is a registered trademark of Dries Buytaert.