* warning: Invalid argument supplied for foreach() in .../modules/signup_status/signup_status.module on line 374.
* warning: Invalid argument supplied for foreach() in .../modules/signup_status/signup_status.module on line 425.

This notice occurs when viewing a signup form and no status codes are set to "Modify the total signup count"

CommentFileSizeAuthor
#3 273972-3.patch389 bytesDeFr
#1 273972.patch1.71 KBDeFr

Comments

DeFr’s picture

Status: Active » Needs review
StatusFileSize
new1.71 KB

Attached patch checks that $codes really is an array before calling foreach on it, thus removing the warnings. It doesn't change the behavior.

jrbeeman’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Assigned: Unassigned » jrbeeman
DeFr’s picture

StatusFileSize
new389 bytes

In fact, the following patch moves the fix to the signup_status_codes function, making sure that it always return an array even if no status matched the given conditions. It should be more generic and remove the need to check if the result was an array or not from every caller. (patch made against the 5.x-1.1 release)

dww’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev
Status: Needs review » Closed (won't fix)

I just tested this in D6 in two configurations:

A) new site with _no_ status codes defined at all.

B) new site with some status codes defined, but none of them are configured to "Show on form".

In both cases, there are no PHP notices or warnings. I think this is a D5-only bug at this point.

I'm not maintaining the D5 version of signup_status at all. The D6 version has been a nearly complete re-write to make this code properly integrate with the main signup.module. I think "won't fix" is the appropriate status here, since I don't know if any of the signup_status maintainers are still working with the D5 version...