My users are paying for their classes and their orders are marked as complete, but they are not actually ending up in the signup list. I see these two errors in the log for every failed checkout/signup:

Invalid argument supplied for foreach() in /public_html/sites/all/modules/uc_signup/uc_signup.module on line 595.

Invalid argument supplied for foreach() in /public_html/sites/all/modules/uc_signup/uc_signup.module on line 630.

The first one is related to $_SESSION (and I gather that the second is because of the first), but beyond that level of investigation I am lost. Any ideas?

Thanks!

Comments

walden’s picture

I was getting the same error messages, but after adding TWO REQUIRED profile fields it works smoothly. However this is not ideal as the two fields won't always be necessary.

@leenwebb did you find a fix?

leenwebb’s picture

Nope, I'm still having this issue.

Can you give me a little more info about how/where to add required profile fields? That actually might be a decent workaround for me.

walden’s picture

1. Enable the profile module
2. Go to /admin/user/profile and create two fields which are required and show on the user registration form

leenwebb’s picture

Oh so you mean the trick is TWO? I already have one required profile field, so you're saying I have to add another? That is mighty weird, but worth a try!

walden’s picture

Yes, two. Mighty weird, I concur! Hence my original post.

leenwebb’s picture

Hmmm, that didn't work for me. Of course I made 3 required fields (first name, last name, phone) so maybe I screwed myself with that. I guess I will un-require phone and see if I make any headway.

Do you have the "Signup Confirm Email" module enabled? I don't (because I don't want it), and am wondering if that could be related?

leenwebb’s picture

Update: Nope, having two required profile fields does not work for me. I am still seeing this error with every single signup.

walden’s picture

@leenweb I only have signup and signup integration for Ubercart enabled.

ezra-g’s picture

Version: 6.x-1.0-beta4 » 6.x-1.x-dev
Status: Active » Postponed (maintainer needs more info)

Does this happen with the latest dev version?

leenwebb’s picture

Status: Postponed (maintainer needs more info) » Active

I am using:
Signup 6.x-1.0-rc6
Signup integration for Ubercart 6.x-1.x-dev (Feb 10 2010)

Mattamatic’s picture

I can confirm I am having the same problem on the latest release. It appears that $_SESSION['uc_signup'] is disappearing somewhere between the order confirm page, and uc_signup_order. All other session variables seem to be present. Happens with both authenticated and anonymous users.

Mattamatic’s picture

Problem seem to be that uc_signup_mark_paid is being called before uc_signup_order, still investigating.

ezra-g’s picture

Thanks @Mattamatic and everyone who has confirmed this. I think this may have to do with the anonymous user having an account created as part of the regular Ubercart checkout process. I hope to look into this son, but patches welcome in the meantime ;).

leenwebb’s picture

Oh, interesting ezra-g, I think you are right -- looking back through my logs I see that every error is preceded by a new user creation and login (that also explains why I was NEVER able to reproduce using my own already-existing test accounts).

Mattamatic’s picture

Just out of curiosity, it there a reason why the "Change temporary signups" action is being called from the "A payment gets entered for an order" trigger? I've only looked at it briefly, but tt appears to me that this trigger gets called before the hook_order submit operation.

ezra-g’s picture

In what situation would a payment getting entered for an order happen before the order was submitted by the user?

Mattamatic’s picture

Well payment gateways (ex. uc_credit.module) implement payment processing using the hook_order submit operation as well. And I am guessing it is the uc_payment_process function which sets off the "A payment gets entered for an order" trigger. So if the payment gateway module weight is higher than the uc_signup module weight, it's hook_order will get called first, setting off the trigger, and nuking the $_SESSION['uc_signup'].

Update:
Confirmed that this is the problem. Quick-fix is to have uc_signup install with a weight of -1, long term move uc_signup_mark_paid logic. I am fairly new to Drupal or else I would patch it myself :)

leenwebb’s picture

Confirmed that this is the problem. Quick-fix is to have uc_signup install with a weight of -1, long term move uc_signup_mark_paid logic.

So does that mean that I could change the weight of uc_signup in the system table to -1 to get the same effect?

UPDATE: I changed the weight of uc_signup to -1 in the system table and am still having this issue with every single signup.

Mattamatic’s picture

What is the weight of your payment gateway module(s) set to?

leenwebb’s picture

Every other uc_ module is at 0. Payment gateway is PayPal Standard (the kind that takes the user to PayPal to complete the transaction), though the error is happening before the payment ever takes place. At least, the logs show that the PHP errors occur, then a few minutes later I get the IPN notification from PayPal.

leenwebb’s picture

Woo hoo! Turns out this was tied in with another issue I was investigating and was solved by http://drupal.org/node/540298#comment-2818976 . (The checkout pane in question was sort of redundant, so I had hidden it. But show it and VOILA! It all works.)

faite’s picture

Using the latest Dev build of Uber and of UC_Signup I get the same invalid.

Invalid argument supplied for foreach() in /httpdocs/sites/all/modules/uc_signup/uc_signup.module on line 662.
Invalid argument supplied for foreach() in /httpdocs/sites/all/modules/uc_signup/uc_signup.module on line 618.

The signups do not get added to the signup list, but they do seem to get added somewhere to the DB as you can't attempt to reregister using the same email.
This doesnt occur in the current stable version of UC

les lim’s picture

Status: Active » Closed (duplicate)

Mattamatic is entirely correct in #17 - I just posted an explanation and patch without realizing someone had already figured it.

#808790: Signups not created - UC_Signup weight should be -1 with some payment methods