Re: Re: Re: Re: Re: Nope Tried upgrading to

Posts: 332
Joined: 08/07/2007
Administrator

After further study, I see what's going on here. Upon submission of the review order form, the submit handler uc_cart_checkout_review_form_submit is called:

<?php
     
...
     
// Invoke hook_order($op = 'submit') to test to make sure the order can
      // be completed... used for auto payment in uc_credit.module.
     
$order = uc_order_load($_SESSION['cart_order']);
     
$pass = module_invoke_all('order', 'submit', $order, NULL);
      ...
?>

At this point uc_credit_order is called with $op == 'submit', this will process the credit card, which in turn triggers the workflow event that updates the status of the order). From there, hook_order is invoked with $op == 'update' (which triggers uc_file_order. However, at this point the new user account hasn't been created.

It's not until later, when the customer is kicked to the order completion page (cart/checkout/complete), uc_cart_checkout_complete calls the function uc_cart_complete_sale which creates a new user account. In short, the uc_credit module processes the card (and updates the order) before there's a user account to be associated with a file (or role as this bug would apply to the uc_roles module as well).

--

-Shawn Conn: If the Name Don't Rhyme It Ain't Mine

File downloads stopped working for orders by anonymous users By: stephthegeek@drupal.org (33 replies) Fri, 03/21/2008 - 18:32