warning: Invalid argument supplied for foreach() in /home/alimadhi/www/d6/sites/d6.context/modules/spaces/spaces.module on line 836.

Here is a simple patch

CommentFileSizeAuthor
spaces-customize_no_block.patch1.43 KBferdi

Comments

rbrandon’s picture

I am also noticing this warning. The class that is throwing this error is now in spaces.spaces.inc in the "space_customizer_block" class.

There are two options for fixing this bug:

1. The one mentioned above where in the submit function you check to see if a valid value has been posted.
2. in the form function do not output the form if there are no blocks to customize (removes the blank fieldset from the UI)

I can provide a patch, should be a small fix.

-Richard

rbrandon’s picture

Current Error Message:

warning: Invalid argument supplied for foreach() in /..../sites/all/modules/spaces/spaces.spaces.inc on line 251

yhahn’s picture

Status: Active » Fixed

This seems to be fixed in latest beta. Please reopen if you keep having trouble.

Status: Fixed » Closed (fixed)

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

rbrandon’s picture

There are still issues when saving the form:

In "spaces_admin.inc" in the function "spaces_customize_form_validate"

It retrieves all customizers "$customizers = spaces_customizers();"

Then tries to pass the form value for each to the coresponding submit function. In the submit function for blocks this value can be null (no blocks to customize)

You recieve a error when using the null value as an array in a foreach.

Error finially bubbles up from:
warning: Invalid argument supplied for foreach() in ....../modules/spaces/spaces.spaces.inc on line 267.

rbrandon’s picture

Status: Closed (fixed) » Active
jmiccolis’s picture

Status: Active » Closed (fixed)

We're no longer maintaining Spaces 1.x, I'd encourage you to take a look at 3.x which we're trying to push to stable.