Got this message when creating a frontpage with Panel Pages

warning: Invalid argument supplied for foreach() in /home2/samitier/public_html/cosasvedere/sites/all/modules/panels/includes/display-render.inc on line 168.

Troubleshooted by casting $display to an array in line 168. Changed the line from

foreach ($display->panels as $panel_name => $pids) {

to

foreach ((array)$display->panels as $panel_name => $pids) {

CommentFileSizeAuthor
#2 display.txt7.63 KBSancho Panza
#2 task export.txt622 bytesSancho Panza

Comments

merlinofchaos’s picture

Can you tell me what you were doing with that panel? That point of the code I don't think should have a display that isn't really a display (and casting should, I think, make the error disappear but also not actually render anything?)

Sancho Panza’s picture

StatusFileSize
new622 bytes
new7.63 KB

I am attaching the export taks
The reason I tried casting was that a print_r of the $display started with "panels_display Object...." so not an array. I am also attaching that.

What I was doing was, I suppose, nothing strange. A stacked 2 columns layout. Two blocks on the top panel with visibility settings from a custom plugin. Nothing in the middle two. One block view and one panel pane view in the bottom panel

merlinofchaos’s picture

Interesting.

These:

stdClass Object
(
    [context] => Array
        (
        )

    [css_id] => mini-panel-
)
stdClass Object
(
    [context] => Array
        (
        )

    [css_id] => mini-panel--1

Those appear to be broken mini panel objects, somehow. I think these are causing the problem, not your main display. I wonder how they are getting to be like this, though.

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)
Flying Drupalist’s picture

Version: 6.x-3.0-beta1 » 6.x-3.0-beta2

I also got this error. I'll come back here when I have more data.

esmerel’s picture

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

No updates for more than 30 days.

afterdark’s picture

Same problem to me. And... NO panels added, no minipanels, no nothing. Just upgraded to panels-6.x-3.1, with ctools-6.x-1.1 dropped new stuff over the old files without disabling module as recommended, then disabled everything and uninstalled everything, to make things work fresh and new. It was when the message "warning: Invalid argument supplied for foreach() in (path to site)/sites/all/modules/panels/includes/display-render.inc on line 168." stucked in every page. Any clues?