This concerns the implementation of hook_order(), as uc_auction_order() and uc_auction_now_order().
For uc_auction_order() I assume, that it was implemented to set the field "purchase = 1" in table "uc_auction", when the user has won the auction.
The function looks now like this:
function uc_auction_order($op, &$arg1, $arg2) {
if ($op === 'submit') {
$nids = array();
foreach ($arg1->products as $prod) {
$nids[] = $prod->nid;
}
// We'll lazily go ahead and dumb-update all of these. No harm if they're
// not actually auctioned products (and therefore not in the table).
db_query('UPDATE {uc_auction} SET purchased = 1 WHERE nid IN (' . db_placeholders($nids) . ')', $nids);
}
}
This hook gets called when an order gets created, which does not mean that it was payed.
I tested a lot but could never detect, that uc_auction_order($op, ...) was called with $op = "submit" and therefore the Query was never executed.
Now my thoughts:
Isn't the product purchased when the user with the highest bid won the auction, because it is binding?
Therefore I suggest to implement this into uc_auction_auc_expired(), like this
function uc_auction_auc_expired($nid) {
db_query('UPDATE {uc_auction} SET purchased = 1 WHERE nid = %d', $nid);
}
May be I am on the wrong way, but I think, we need some discussion here. Can someone explain, what the hook_order()-implementation is supposed to do...