3 replies [Last post]
bloke_zero's picture
Offline
Joined: 03/24/2009
Juice: 62
Was this information Helpful?

I'm having a problem with the uc_checkout_complete conditional actions not triggering. Putting some additional logging in I can see that there are problems in when trying to evaluate the conditional actions:

uc_order_status_update fails with "no predicates"

uc_checkout_complete fails with "not enough arguments"

Any idea what I should look at? It's Drupal 6.12 and UC RC 3.

Thanks

Alex

------------------------------
http://zero-design.info

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: ca uc_checkout_complete not enough arguments

"No predicates"? That's definitely odd because there should be some by default, even if the conditions aren't right for them to do anything. I suppose if they'd been disabled, that's what would come up.

If the uc_checkout_complete trigger doesn't have enough arguments, I'd like to know which arguments are missing. Figuring out why sounds like our goal.

bloke_zero's picture
Offline
Joined: 03/24/2009
Juice: 62
narrowing it down

Hi Lyle,
thanks for getting back. I'm narrowing it down a bit. It seems like it works with the default gateway but not the worldpay gateway, but it used to work with the worldpay gateway. The code for the arguments is:

  // Fail if we didn't receive the right type of or enough arguments.
  if (!$arguments) {
    $log_message = $trigger." not enough arguments";
    watchdog('ca_pull_trigger', "$log_message");
    return FALSE;
  }

So it looks like it isn't getting any arguments at all. What could be going wrong? I did an upgrade around that time to RC3, I'll have a look at the default gateway and see if I can figure out the differences, but any help gratefully received!

Alex

------------------------------
http://zero-design.info

bloke_zero's picture
Offline
Joined: 03/24/2009
Juice: 62
Solution

Finally narrowed down the problem. The problem only occurs if you're signed in, which as we have ubercart set to deny anonymous transactions meant that it never worked.

When you're coming back from worldpay you aren't actually logged in, so there is no user data, but if you add:

if ($args[0]=='uc_checkout_complete'){
  if (!$args[2]) $args[2]=user_load(array('uid'=>$args[1]->uid));
}

after

$args = func_get_args();

in function ca_pull_trigger() in the ca.module to ensure that the user data is present it all works. Obviously this is an installation specific hack rather than a solution. But stock is decremented and the e-mails get sent.

Thanks to AP for solving it.

------------------------------
http://zero-design.info