invalid argument supplied for foreach() in /var/www/sites/xxxxxx/drupal-6.14/sites/all/modules/skinr/includes/handlers.inc on line 72

I took a quick look and didn't see anything obvious. This is the latest dev version Sept 28

Comments

moonray’s picture

Need some more info on this one. Which themes were enabled at the time the error occurred? Were any of them non-Skinr themes? Also, what were you doing when the error occurred?

jacine’s picture

Status: Active » Fixed

I'm going to assume this is fixed and close this considering we have not been able to reproduce and no one else has mentioned it. Feed free to reopen with more information if you come across it again.

joeyonline’s picture

Status: Fixed » Active

Actually is still occuring on the current live release (6.x-1.0).

I'm using the base AdaptiveTheme and when I go to make a change to a block (/admin/build/block) and then save I receive the error "warning: Invalid argument supplied for foreach() in /home/my_site_domain/dev1/sites/all/modules/skinr/includes/handlers.inc on line 72."

Adaptive Theme Info:
version = "6.x-1.5"
core = "6.x"
project = "adaptivetheme"

When the error occurs the save fails and you have to try to save again. Most times it works but I believe I have seen the second attempt save fail as well from time to time.

// Line 72 in handlers.inc :

foreach ($form_state['values']['skinr_settings'][$module .'_group'] as $theme_name => $theme) {

// And below is a dump of my $form_state array captured just before the foreach:

Array
(
    [storage] => 
    [submitted] => 1
    [values] => Array
        (
            [module] => menu
            [delta] => menu-footer-navigation
            [title] => 
            [custom] => 0
            [roles] => Array
                (
                    [1] => 0
                    [2] => 0
                    [3] => 0
                )

            [visibility] => 0
            [pages] => 
            [op] => Save block
            [submit] => Save block
            [form_build_id] => form-b641958902b38b5b0c3c8854869e3839
            [form_token] => cbfd8cc56b7c6d7b7e1ebb3550ab5992
            [form_id] => block_admin_configure
        )

    [clicked_button] => Array
        (
            [#type] => submit
            [#value] => Save block
            [#post] => Array
                (
                    [title] => 
                    [custom] => 0
                    [visibility] => 0
                    [pages] => 
                    [op] => Save block
                    [form_build_id] => form-db2f21a8a3186319ff251b6aa6cd8bb5
                    [form_token] => cbfd8cc56b7c6d7b7e1ebb3550ab5992
                    [form_id] => block_admin_configure
                )

            [#programmed] => 
            [#tree] => 
            [#parents] => Array
                (
                    [0] => submit
                )

            [#array_parents] => Array
                (
                    [0] => submit
                )

            [#weight] => 0.006
            [#processed] => 
            [#description] => 
            [#attributes] => Array
                (
                )

            [#required] => 
            [#input] => 1
            [#name] => op
            [#button_type] => submit
            [#executes_submit_callback] => 1
            [#process] => Array
                (
                    [0] => form_expand_ahah
                )

            [#id] => edit-submit
        )

    [redirect] => admin/build/block
)

Hope this helps.

Thanks

jacine’s picture

Status: Active » Postponed (maintainer needs more info)

Thanks for the information. I just spent that last hour trying to reproduce this and I'm not having any luck. Can you answer please provide us with this information?

1 - Which themes were enabled at the time the error occurred?
2 - Were any of them non-Skinr themes?

joeyonline’s picture

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

It was just the base AdaptiveTheme (version 6.x-1.5) that I downloaded last week from the Drupal.org website at (http://drupal.org/project/adaptivetheme).

I did just notice though while visiting the page that a newer version is now out (6.x-1.6). Should I give that a try for this problem?

Oh Also: in addition to the blocks page I mentioned earlier, I just experienced it on the Content Types (/admin/content/types) page as well. Just passing it along.

Thanks

jacine’s picture

Thanks Joey,

Yes, that would be very helpful. Please try the newer version with this patch applied to AT's .info file: http://drupal.org/node/609758.

joeyonline’s picture

Thanks Jacine - I'll let you know how it turns out.

moonray’s picture

It seems to me this might be happening due to an incompatibility with a module.

The $form_state that was posted in #3 shows no $form_state['values']['skinr_settings'], which means that something removed it in validation perhaps?

joeyonline’s picture

Thanks Jacine ( &moonray ),

The base Adaptive Theme update(6.x-1.6) along with your patch (Jacine - http://drupal.org/node/609758) seems to have done the trick. I'm seeing the Skinr functionality working and no errors on save now.

I'll keep an eye on it and let you guys know if it pops up again.

Thanks Again,
Joey

moonray’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

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