I have created a Drupal site for a client who needs the ability to sell event tickets to members & non-members. Obviously the combination of Ubercart and this module would be ideal for my project.

I have installed uc_signup as detailed in the installation instructions. When someone purchases a ticket, it proceeds through the entire checkout queue but when you click 'submit' one of two things happen depending on the payment method - but either way it doesn't work properly! I'm not sure if I have two separate problems or just one.

If I choose to pay via credit card (I am using the test gateway at the moment but will be using Paypal Web Payments Pro when the site goes live), it throws up the following errors after clicking submit:

• warning: Invalid argument supplied for foreach() in (long path here)/website/sites/all/modules/uc_signup/uc_signup.module on line 650.

• warning: Invalid argument supplied for foreach() in (long path here)/website/sites/all/modules/uc_signup/uc_signup.module on line 686.

I'm not quite sure where to start with those errors!

If I choose to pay via cheque, it doesn't throw any errors, and it does sign up a user to an event, but for some reason it does not actually connect that user to the event. Instead, it signs up an 'anonymous user' despite the fact that the user who bought the ticket is a member of the site (it even does it for the admin). If I view signups for the event, I am presented have a list of anonymous users signed up instead of the actual members. If I click to view the anonymous user's signup details, it lists an email address like "placeholder-108549@example.com". If, however, I sign someone up through the backend it works, but it avoids Ubercart completely so no transaction takes place and therefore uc_signups are not involved, so I don't think the problem is with Signups.

The versions I am using are as follows:

Drupal 6.17
Ubercart 6.x-2.3
Signup 6.x-1.0-rc6
uc_signup 6.x-1.0-beta5

I have no idea if it's the way I've set things up or if this is a real bug. I have read through loads of previous bugs and can see that there were problems with payment gateways before but they have been marked as closed now. I have also noticed comments about 'required profile fields' but I cannot find anywhere what these fields might be? I'm wondering if this might be my problem? Any help would be greatly appreciated! Thanks in advance.

CommentFileSizeAuthor
#24 861058.patch971 bytesezra-g
#8 uc_signup_861058.patch773 bytesdaveparrish

Comments

adrian_a’s picture

Subscribing.

Apparently, here is one of the problems:

function uc_signup_create_placeholder_signup($nid, $uid, $oid) {
$mail = 'placeholder-' . rand(111111, 99999) . '@example.com';
$signup_form = array(
'uid' => 0,
'signup_anon_mail' => $mail,
'nid' => $nid,
);

The email is not taken from the new account and deliberately set to some random value. And the user id is set to 0.

spylvas’s picture

I am having the same problem. Subscribing

crystaldawn’s picture

This is indeed a bug. I've encountered the same problem.

daveparrish’s picture

I believe this is the same problem as reported here: #722954: Invalid argument foreach(), line 595 and 630 and here: #540298: Signups not created when off-site payment methods fail to call hook_order case submit. . The problem, I think, is that the weight is not being set to -1 on install. It looks like the weight is only getting set to -1 on updates.

I changed the modules weight to -1 using the SQL query

UPDATE `test_db`.`system` SET `weight` = '-1' WHERE `system`.`filename` = 'sites/all/modules/uc_signup/uc_signup.module';

and then I didn't get the errors anymore.

49digital’s picture

Hero! Thanks for that. I tried that and it does indeed work for the credit card payments problem - no more errors and no anonymous users signed up.

I am still having the same problem, however, when users pay with check. It still just signs them up as anonymous users. Is this a separate problem?

adrian_a’s picture

Thanks dmp1ce for your reply.
Unfortunately, this doesn't solve the anonymous signups regardless of the payment method.
I will give up this module and I'll test this one: http://drupal.org/project/signup_pay
If the tests will fail then I shall start patching. Oh joy ...

adrian_a’s picture

Hello everybody.

I think I figure it out, the problem was indeed in the function
uc_signup_create_placeholder_signup for module uc_signup

function uc_signup_create_placeholder_signup($nid, $uid, $oid) {
$mail = 'placeholder-' . rand(111111, 99999) . '@example.com';
$signup_form = array(
'uid' => 0,
'signup_anon_mail' => $mail,
'nid' => $nid,
);

$sid = signup_sign_up_user($signup_form, FALSE);

The uid should not be set to 0 because this means anonymous user. Also, the signup_anon_mail should be filled in only for anonymous users.

That been said, the function should look like this:

function uc_signup_create_placeholder_signup($nid, $uid, $oid) {
$mail = 'placeholder-' . rand(111111, 99999) . '@example.com';
$signup_form = array(
'uid' => $uid,
'signup_anon_mail' => $uid ? null : $mail,
'nid' => $nid,
);

$sid = signup_sign_up_user($signup_form, FALSE);

signup_sign_up_user, for anonymous users, expects a value for signup_anon_mail (from signup module), otherwise, uid is used for user retrieve

Hope this solves your problem, it did for me.

daveparrish’s picture

StatusFileSize
new773 bytes

Yep, that worked for me too adrian_a. I attached the patch.

Thank you!

ezra-g’s picture

It's 100% intentional that the placeholder signup is associated with uid 0. When the signup is paid for/finalized with Conditional Actions, it is assigned to the uid.

Did you all run update.php after updating to beta 5?

I'm at a DrupalCamp but hope to take a look at this issue soon.

daveparrish’s picture

I installed uc_signup on version beta 5. Will installing run through the update path?

spylvas’s picture

I have a clean install as well. I never had any other version than beta 5..

49digital’s picture

Fantastic! Thanks for the patch, it's solved my problem as well.

Mine was a clean install of beta5 as well.

civicpixel’s picture

#4 resolved this issue for me.

In regards to the #5 problem with check processing, the user is only temporarily shown as anonymous until the order is processed as complete as stated by ezra in #9.

figover’s picture

Thank you dmp1ce, about this query. I run this query and error is not coming. You are becoming a good drupaller

echoz’s picture

I get the same errors on the same lines, using the same versions listed by the original poster. Using test gateway. The order goes through with status Completed, but it does not become a signup. According to the module author in #9 the patch in #8 is not the fix, so it seems I shouldn't bother testing that patch, just reporting + subscribing.

echoz’s picture

Version: 6.x-1.0-beta5 » 6.x-1.x-dev

Adding to my report, now with 6.x-1.x-dev (Jul 11), patched with #5 in #848726: Temporary signups not being canceled in uc_signup_order using test gateway -

I still get the same 2 errors on completing checkout (as original post) -
Invalid argument supplied for foreach() … uc_signup.module on line 650 + 686

With order status Completed but no signup created. Also the Profile field that was correctly offered before checkout (Name) is not recorded in the user account

miss-susan’s picture

Subscribing - I am having the same issue with both 6.x-1.0-beta5 and 6.x-1.x-dev. I have two profile fields enabled and am checking out with the test payment gateway using an existing account or a new account. I tried the fix in #7, and it didn't work. Same error as everybody else: Invalid argument supplied for foreach() … uc_signup.module on line 650 + 686

49digital’s picture

If it is intentional that the signed up user is anonymous until paying, this will be a problem for my use-case, as my client has members who routinely pay after the event has occurred. So, it is absolutely necessary that they can see who is signed up for an event before the event takes place (to print nametags etc) regardless of whether or not they have paid. The patch at #8 solves this problem for me.

crystaldawn’s picture

This patch appears to work for me as well. TY. A suggestion would be rather than trying to use the uid as a placeholder, which should never happen, you should instead attach a new bool flag to the user object to flag it as such instead. Using uid's, nid's, etc as anything other than id's is generally a bad idea. They werent meant to be used as placeholders, flags, etc. If you want to flag something as unpaid for example, dont try doing it using the uid lol. Use a custom flag instead :)

echoz’s picture

#4 (thanks @dmp1ce) manually setting the module's weight in the database solved the errors and also now signups are created. Using 6.x-1.x-dev from Aug 1 with *no patches*, using test gateway.

Getting closer - now that I get signups, I am having the issue of temporary signups not getting deleted as described in #848726: Temporary signups not being canceled in uc_signup_order

LisaX’s picture

Using beta5, test gateway. Used Patch from #8. Still having problems.
For only signing up with mulitiple attendees per node/event. But not when i sign up for only one attendee.
After payment succesfull, i get this error line for EACH attendees signed up who doesn't have an account yet.

"warning: Invalid argument supplied for foreach() in /x/modules/ubercart/contrib/uc_signup/uc_signup.module on line 664."

I'm trying to figure it out, but it seems like the signupmodule doesn't catch the emailadresses from new-users.

Subscribing

echoz’s picture

@LisaX - there has been a notice on the project page to "use the dev version until Beta 6 is rolled".

LisaX’s picture

@echoz.
Thanks for the advice. However, I've downloaded and installed the dev version.
but i still get the same error, in fact it's even worse. The error shows before the signup attendee get to the payment provider, when using Beta5 at least I can get the attendees paid first... and when they return, then they'll see this error.

"warning: Invalid argument supplied for foreach() in /ubercart/contrib/uc_signup/uc_signup.module on line 661"

ezra-g’s picture

Title: uc_signup not not connecting properly with signup module » Duplicate signups created durring finalization
Status: Active » Fixed
StatusFileSize
new971 bytes

uc_signup_mark_paid(), which finalizes the orders, was creating a duplicate signup as it was leaving the placeholder signup in place, and creating a new one for the finalized signup.

I've committed this patch which corrects the problem. Per comment #4, UC_Signup should have a weight of -1 after being installed already.

mrconnerton’s picture

subscribe

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

esbon’s picture

I would like to apply this patch, but there is one thing I did not understand. Do I apply both patches or just the second patch

Thanks

echoz’s picture

@esbon, the patch in #24 has been committed to the dev version since Aug 21.

esbon’s picture

Thanks, the module's page says to use the dev version until beta 6 is rolled out. I am sorry I did not see this. I did apply the last patch to beta 5 and it's working with the exemption that the name and phone fields appear empty in the node's Signups tab. What shall I do, install the dev version on top of beta5 or just wait for beta 6?

Thanks again for your reply