Download & Extend

_userpoints_transaction and txn_id do not set moderated status

Project:User Points
Version:6.x-1.x-dev
Component:Code: userpoints API
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (works as designed)

Issue Summary

_userpoints_transaction treats the moderate parameter correctly, when txn_id is not set, but ignores it when updating an txn_id.

Somebody familiar with the module, please check, whether other variables should be altered, before joinig the array.

Index: userpoints.module
===================================================================
--- userpoints.module   (revision 762)
+++ userpoints.module   (working copy)
@@ -735,6 +735,13 @@
   $params['changed'] = $time;

   if (is_numeric($params['txn_id'])) {
+    if ($params['moderate'] == true) {
+        $params['status'] = 1;
+      }
+      else {
+        $params['status'] = 0;
+      }
+
     //A transaction ID was passed in so we'll update the transaction
     $result = db_query("SELECT txn_id, uid, approver_uid, points,
       time_stamp, status, operation, description, reference, expirydate, expired,

Comments

#1

Status:active» closed (works as designed)

This is by design. moderate can only be used for new transactions, when updating existing transactions, you need to use status directly.