warning: Invalid argument supplied for foreach() in /srv/web/staging/emberhalasz.hit.hu/sites/all/modules/signup_status/modules/signup_status_limit/signup_status_limit.settings.inc on line 150.
warning: Invalid argument supplied for foreach() in /srv/web/staging/emberhalasz.hit.hu/sites/all/modules/signup_status/modules/signup_status_limit/signup_status_limit.settings.inc on line 195.

This warning also appears on page /node/*/signups/settings when i save it.

Comments

dww’s picture

Title: Warning at saving /admin/settings/signup » Warning at saving signup status limit settings when the site has no status codes defined
Assigned: Unassigned » dww

Yup, I can reproduce that on a site without any status codes defined. If you enable signup_status and signup_status_limit, you should define some status codes. ;) But, if you don't, it shouldn't throw PHP warnings. So yeah, this is a bug, and it should be a pretty easy fix...

dww’s picture

Status: Active » Needs review
StatusFileSize
new2.48 KB

Like so. In addition to preventing the PHP warnings, I also added some form validation so people don't try to save a bogus configuration of per-status limits when there are no status codes.

kardave’s picture

Status: Needs review » Reviewed & tested by the community

All right!

I didn't know it would appear if i start really using status codes :)

Thanks your quick answer and solution!
I applied the patch, it works great now.

Dave

dww’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks for the review and testing.

Status: Fixed » Closed (fixed)

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