Hi
I get the following warning on a panels contactpage.

Invalid argument supplied for foreach() in /home/aromakok/domains/aromakok.se/public_html/sites/all/modules/ctools/plugins/content_types/node/node.inc on line 46.

the line says:

foreach ($panel_args as $id => $arg) {
$nid = str_replace("@$id", $arg, $nid);
}

anybody know what it's about?
Thanks
Martin

Comments

chesterton_martin’s picture

Title: Invalid argument supplied for foreach() in /home/aromakok/domains/aromakok.se/public_html/sites/all/modules/ctools/plugins/conte » Invalid argument supplied for foreach() in /sites/all/modules/ctools/plugins/conte
Anonymous’s picture

I'm getting the same error, but this time on an All blogs page. It's fine if there's no content, but if I add an existing node I get an error message on the /blog page:

warning: Invalid argument supplied for foreach() in /home/sites/haringeyshed.org/public_html/newsite/sites/all/modules/ctools/plugins/content_types/node/node.inc on line 46.

And if I add a block display of a view I get:

warning: Invalid argument supplied for foreach() in /home/sites/haringeyshed.org/public_html/newsite/sites/all/modules/ctools/views_content/plugins/content_types/views.inc on line 131.

as well.

It doesn't stop the content from being displayed, but I would like to sort it out.

Anyone got any ideas?
Thanks!

Matt

UPDATE:

I removed lines 46 of node.inc and 131 of views.inc just to see what happened, and the error messages went away. Turns out it was the same bit of code causing a problem in each:

  foreach ($panel_args as $id => $arg) {
    $nid = str_replace("@$id", $arg, $nid);
  }

If I leave the code out permanently, will it do terrible violence to the rest of the module or should it be ok?

Thanks!

nickgunman’s picture

This works in my case (views in blog).
if($panel_args)
{
foreach ($panel_args as $id => $arg) {
$nid = str_replace("@$id", $arg, $nid);
}
}