hi
i have installed pannels on a Drupal 4.7.2. i have created one 2 pane pannel for one URL and evertime i select this URL i get a error
warning: Invalid argument supplied for foreach() in c:\Inetpub\wwwroot\drupal\modules\panels\panels.module on line 695.
what is wrong?
Regards
Marc
Comments
Comment #1
taozen commentedI am receiving the same error. I am running 4.7.3.
Any input? This looks like it is a great module.
Comment #2
merlinofchaos commentedThat error indicates it wasn't able to find any layouts, which mind mean you have a broken installation. Be sure that you have your 'panels' directory with panels.module in it, and you have the 'layouts' and 'content_types' directories beneath that.
Comment #3
newms commentedI am getting the exact same error, but I have the panels.module in the panels directory, and I the 'layouts' and 'content_types' directories beneath that. Any help?
Comment #4
marc.bauhere is my directory structure, with the files in it. I think this is correct.
Comment #5
serving commentedI am using 7.3 and a fresh CVS panels install.
I am getting the same error. I installed buy wget and tar zxvf in the modules dir like I usually do. The dir structure seems ok..
Module does not work still.
Serving
Comment #6
merlinofchaos commentedI just committed code that I think will fix this.
You can quickly test this by changing line 745 of panels.module to:
Comment #7
rl commentedI just downloaded the latest panel from Drupal today.
I get the following error when I try to create a panel page. The version of microcontent is from 8/28 GMT.
My error is
warning: Invalid argument supplied for foreach() in /home/pittsfor/public_html/modules/microcontent/microcontent.module on line 241.
Of course, disabling microcontent makes the error go away. I have not done anything with microcontent except enable it.
Rich
(rl)
Comment #8
newms commentedHi Merlin,
I am still getting the same warning, even with the update. The warning says:
warning: Invalid argument supplied for foreach() in /var/www/html/mydrupal/modules/panels/panels.module on line 696.
Am I doing something wrong? The directories are in the correct place.
Thanks,
Sean
Comment #9
merlinofchaos commentedrl, Please don't take over issues with new problems.
The microcontent issue may or may not be related, but it wasn't in the original reports, and the error you show is completely different. And I don't know anything about the microcontent.module -- since that's the module that's giving the error, you should file an issue against microcontent (and possibly a separate issue against panels and post links from each issue to the other so that we can cross reference).
newms: Argh. I don't know why you're having that problem. :/ I'll look into it further. It's difficult because I can't reproduce it so I can only take guesses as to why it fails for you.
Are you using PHP5?
Comment #10
newms commentedNo I'm using PHP 4.3.9.
Comment #11
newms commentedI found out what the problem was. I was entering content on the panels in node form, e.g node/3 rather than the title of the page or the NID.
Thanks for your efforts Merlin.
Comment #12
marc.bauyes, i'm using PHP 5.1.0.0
Comment #13
marc.bauAs a short note - the fix
require_once('./' . $file->filename);
seems working here! I will do more testing and come back then!
The microcontent issue is a microcontent module issue and not this issue, but asside i have this microcontent, too.
Comment #14
merlinofchaos commentedOk, there are so many different people getting errors in this issue, and some are fixed and some are not.
If there are still existing errors -- and I believe there are -- please file new issues so I can keep track of what's going on?
newms: Could you please file a separate bug about the node/3 input giving that error? It should give a much more meaningful error with that input.
Thanks!
Comment #15
(not verified) commentedComment #16
knubbe commentedI can confirm this bug.
I'm using Drupal 5 (RC 2).
Panel version: // $Id: panels.module,v 1.10 2006/10/31 23:49:58 merlinofchaos Exp $
"warning: Invalid argument supplied for foreach() in /path/to/modules/panels.module on line 697."
On line 497: "foreach ($panels->content as $location => $list)" there's no check first if $panels-content is an array or not, so if there's no content added PHP will output a warning, since $panels->content isn't an array.
Two possible fixes:
1) turn off warnings in php.ini (ugly fix)
2) add a check in panels.module
Replace:
foreach ($panels->content as $location => $list) {
foreach ($list as $area) {
$function = $content_types[$area->type]['callback'];
if (function_exists($function)) {
$content[$area->area] .= $function($area->configuration);
}
}
}
With:
if (is_array($panels->content)) { // this line is new
foreach ($panels->content as $location => $list) {
foreach ($list as $area) {
$function = $content_types[$area->type]['callback'];
if (function_exists($function)) {
$content[$area->area] .= $function($area->configuration);
}
}
}
} // this line is new too
Cheers
Comment #17
merlinofchaos commentedThe error you mention (which btw was opened in a separate issue, as I instructed when I marked the issue fixed) is fixed in Panels 1.1
Comment #18
(not verified) commented