Closed (duplicate)
Project:
AD Gallery
Version:
6.x-1.9
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Dec 2010 at 12:08 UTC
Updated:
14 Mar 2011 at 15:49 UTC
when i try to add comment, im having this warning:
warning: Invalid argument supplied for foreach() in /home/pinoybar/public_html/drupal/modules/ad_gallery/ad_gallery.theme.inc on line 28.
warning: Invalid argument supplied for foreach() in /home/pinoybar/public_html/drupal/modules/ad_gallery/ad_gallery.theme.inc on line 34.
Comments
Comment #1
maikeru commentedI think this is because in the theme function is trying to load the node based on args().
So it will work on paths such node/1 but not on somethimg like comment/reply/1.
It seems the $vars variable passes a node object, so in ad_gallery.theme.inc instead of node_load(args(1)), I just replaced it with:
Edit: See #1061050: Node is retrieved from arg in preprocess function instead of get from $vars for patch.
Comment #2
tunicAs maikeru stated, this seems to be the same problem as #1061050: Node is retrieved from arg in preprocess function instead of get from $vars. Apply that patch and it should be ok. The patch includes the change that maikeru suggests plus another one related that solves a similar issue (using arg(0) instead of node directly).
I'm marking this bug as duplicate.