Using version 6.x-1.0-rc5 I'm getting the following warning when checking out:

warning: Invalid argument supplied for foreach() in /var/www/vhosts/xxxxxxxx/sites/all/modules/uc_signup/uc_signup.module on line 601.

I do not have any fields configured in /admin/user/profile.

I'm telling Ubercart to send user account information to new users, and to unblock them, but BOTH of these are failing. Perhaps this is related?

CommentFileSizeAuthor
#15 585656.patch2.71 KBezra-g

Comments

greggles’s picture

I do not have any fields configured in /admin/user/profile.

I think this might also happen if people have fields but none of them are shown on the registration page. I kind of think we should remove the dependency on profile module if it's at all possible.

agileadam’s picture

I'm telling Ubercart to send user account information to new users, and to unblock them, but BOTH of these are failing. Perhaps this is related?

Account information is being sent to the user successfully. Also, the user is created as active. These were, in fact, both working prior to adding two signup fields (see below).

Also, after adding First Name and Last Name signup fields, there is no warning message when completing a checkout.

ezra-g’s picture

greggles is indeed correct here. We should make the core profile module optional, probably as part of an implementation that would also support content profile (#527700: Optional Content Profile support, and make core profile optional as well).

As for the user accounts being blocked, that is a separate issue. After checking a development site where this is in use it seems that the user accounts are defaulting to blocked even when it is functioning correctly. Not a good default.

ezra-g’s picture

Actually, after further investigation, users are not created as blocked by default -- That would have happened in earlier versions of uc_signup, when we used user_save instead of drupal_execute to create the new accounts. If the accounts are being created, with the latest version of uc_signup, I would expect that they would be active regardless of these foreach errors. Can you specify which version of uc_signup you're using?

ezra-g’s picture

Status: Active » Postponed (maintainer needs more info)
ezra-g’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Closing due to lack of response.

puneet63’s picture

Version: 6.x-1.x-dev » 6.x-1.0-beta4
Status: Closed (fixed) » Active

I am also running with the same issue with uc_signup 6.x-1.0-beta4 version.

In my case I am not taking any optional content profile parameter.But after completing the order it shows the following Error:
" warning: Invalid argument supplied for foreach() in ../sites/all/modules/ubercart/uc_signup/uc_signup.module on line 601. "

Modules & Versions used:
signup - 6.x.1.0-rc6
ubercart- 6.x.2.2
drupal - 6.15

I need it as the earliest.

Thanks in advance

greggles’s picture

@puneet - do you have the profile module enabled with at least one field?

puneet63’s picture

Hi Greg Thanks for responding

Yes we have profile module enabled but we do not added any field because we just want to take email of the attendees.

So Is there any way to fix it without having field on profile module?

puneet63’s picture

Still Looking for response

ezra-g’s picture

Status: Active » Closed (fixed)

uc_signup doesn't currently support not having profile fields. For more about how it could support them, please see #623900: API for additions to attendee info form.

greggles’s picture

Perhaps in the interim uc_signup could have a hook_requirements implementation that requires profile fields with the proper settings (i.e. a field that is visible on the registration form, right?). This would at least make sure people have their sites configured properly.

ezra-g’s picture

Title: Invalid argument supplied for foreach() » hook_requirements to notify users to create profile fields
Category: bug » feature
Status: Closed (fixed) » Active

Yes, this seems like a good idea. At the very least, we should probably avoid these invalid arg foreach errors.

lyricnz’s picture

Why is invalid to have no profile fields? Especially if using content_profile.

ezra-g’s picture

Version: 6.x-1.0-beta4 » 6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new2.71 KB

UC_Signup doesn't support content_profile. Currently the checkout workflow is optimized to use profile fields, but could be modified to skip a checkout phase if you were using it to only check out the current user.

Here's a patch for a hook_requirements implementation.

ezra-g’s picture

Status: Needs review » Fixed

This is now committed.

Status: Fixed » Closed (fixed)

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