Closed (duplicate)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.10
Component:
fieldgroup.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Oct 2007 at 08:13 UTC
Updated:
28 Jul 2010 at 08:02 UTC
Jump to comment: Most recent
Comments
Comment #1
bsuttis commentedI missed a step above, make sure Fieldgroup is enabled and the nodereference field is in a fieldgroup.
Hoping the problem would go away if I simply disabled fieldgroup, taking the nodereference field out of a fieldgroup prevented the error from showing. However, deleting a referenced node still causes the empty div wrapper to show until I resubmit the node holding the nodereference field. Hope that makes sense.
Comment #2
aterchin commentedi have a similar issue also, which gives me the error on the frontpage view. happens after creating a fieldgroup, whether i've assigned a field to it or not. i'll tab over on firefox and refresh my frontpage and there's the error.
had field groups for a usernode profile as well as my 'article' content type. still need to mess with it a little more.
seems like such an obvious problem that it would have been found by more than the handful i keep running into around drupal searches (so maybe its my setup somewhere, dont know). just adding my two cents here.
warning: Invalid argument supplied for foreach() in .../sites/all/modules/cck/fieldgroup.module on line 394.Comment #3
bsuttis commentedBump.
This error really throws a wrench into the workflow. Essentially I can't just delete a referenced node without first removing it from its parent node before deletion without causing the error. Is it possibly a matter of modifying hook_nodeapi to update the parent node on its reference node deletion, or is the issue deeper?
Comment #4
Anonymous (not verified) commented+1 Tracking
Comment #5
kenorb commentedI've the same issue.
Followed similar nodes are passed to function fieldgroup_nodeapi() in fieldgroup.module
My fix is:
Instead of:
Comment #6
bsuttis commentedThe above appears to remove the error messages, but my node's are still left with the deleted reference node's div remnants.
Comment #7
emilyf commentedSame problem. Subscribing.
Comment #8
artis commentedAdd me to the list.
Comment #9
njehlen commentedsubscribing
Comment #10
shooommmm commentedHi everyone,
I have the same problem:
warning: Invalid argument supplied for foreach() in /home/newmill/public_html/sites/all/modules/cck/fieldgroup.module on line 394.
Can someone help ?
Thanks,
Hanly
Comment #11
cwittusen commentedI have the same problem as well and it doesn't seem like someone has a solution to it yet?
Comment #12
kshahan commentedI also have same problem. Came up when I added advanced profile module. Struggling to find a fix..seems like my website has slowed down as a result.
Kerry
http://www.writingmate.com
ps. I'm searching to see if anyone is interested to work on writingmate as a co-developer. Please contact me if interested.
Comment #13
geek-merlinsimilar problem here
Comment #14
pcs305 commentedSame problem, Subscribing
Comment #15
quiptime commentedI think you can test this node.module hack
Quick fix: http://drupal.org/node/164499#comment-656606
I think that fix the probleme with the error
warning: Invalid argument supplied for foreach() in .../sites/all/modules/cck/fieldgroup.module on line 394.I had the same problem with drupal 5.7 and many contributed modules.
Comment #16
pcs305 commentedAfter applying the fix to node.module, the
warning: Invalid argument supplied for foreach() in .../sites/all/modules/cck/fieldgroup.module on line 394.still shows up.
I'm tracing back in the log and it's starting to look like Advanced Profile module or Panels2 that caused the start of these messages.
Not 100% on that though.
Comment #17
benansell commentedI think I have the same problem; definitely have the same symptoms. I cannot directly trace back the root cause to a deleted referenced node. However, I am experiencing this error message when I get a teaser list of nodes back from Search module working in concert with Taxonomy.
The node type in question does have some node reference fields defined to display within a fieldset when viewed in a teaser list view. They are defined to display within tabs in a 'full view'.
Subscribing ..... Is there an an ETA on having a fix?
If fix isn't any time soon, is there a set of steps that can be taken to get rid of the error messages for the time being until the root cause is addressed?
Thx!
Comment #18
yched commentedFixed in D5 and D6 branches. We now test if node_load() returned a valid node before attempting to display it.
Comment #19
ariana commentedI upgraded to the development snapshot from 3-24-08 and I'm still getting this same error.. the fix didn't seem to work for me. Did anyone else try it??
Comment #20
yched commentedThen you need to be more specific about exactly where and when you see the errors. Maybe it's unrelated to the issue in the thread.
Comment #21
bsuttis commentedUsing the latest dev snapshot, the problem I first posted is fixed from my testing. Thanks much.
Comment #22
pcs305 commentedAfter upgrading to the latest dev, the messages seems to be gone! I will give it 24 hours to make sure.
Thanks for the fix yched.
EDIT:
It's been more than 24 Hours now, and the messages are gone. And I had hundreds of them per day!
Thanks for the Fix.
Comment #23
ariana commentedSorry about my lack of specificity..
I get the error only when viewing usernodes. 1 of my usernodes throws no error, but all the rest do, and even that one that wasn't did once.. so I'm thoroughly confused!
One of the children of the usernodes (node profile) has a group set up.
Changing line 394 to: if (!empty($group['fields'])) foreach ($group['fields'] as $field_name => $field) {
gets rid of the error messages, but there are still these red empty divs that are showing as unpublished nodes, in firebug it shows:
div id="node-" class="node node-unpublished"
Comment #24
EgonO commentedsame problem here. the error displays on the frontpage. using 5.x-1.6-1
subscribed ;)
Comment #25
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #26
yngens commentedI started to have this error since I added usernode as a recommended part of Advanced Profile. I have:
PHP version 5.2.5
MySQL version 5.0.45-community
Comment #27
joehenriod commentedI also am getting this error, I have Advanced Profile
Comment #28
jason.fisher commentedExperiencing this with 5.7, using cck, nodeprofile, usernode.
Comment #29
moonray commentedSame problem which persists after updating to 5.x-1.7 (which purportedly has this fixed).
Comment #30
jrbeemanThis issue is occurring for me, as well, using the 5.x-1.7 release. I was able to get rid of the error messages by wrapping the foreach() on line line 394 of fieldgroup.module with a simple if()... see below for the resulting code block. My only concern is that I don't know the underlying code well enough to know if the issue is deeper than this.
Comment #31
bascostbudde commentedsubscribing.
My tracing gets me to the point that the nodeapi hook is called with something that is not really a node. Will post back when more info.
[edit] confirmed: when node_view is called with something that is not a node object, the arriving call at fieldgroup_nodeapi chokes.
In my case, this is the result of using too wide a query in a custom module.
Comment #32
oschirok commentedsubscribe too, having issue with nodeprofile and nodefamily
Comment #33
MGParisi commentedtesting #30
Comment #34
MGParisi commentedDuplicate, closed
http://drupal.org/node/168045
Comment #35
reed.richards commented+1
Comment #36
kdavis005 commentedSubscribe..
Comment #37
m_freeman2004 commentedHi. I'm getting the above error on my site, leading to "Page not found" errors on all nodes. Recently upgraded from drupal 5.2 to 5.15 which is when the problem started. Using CCK 5.15-1.10 with Views and Panels2 if that helps. Anyone else getting this issue? Please help... :) M.
Comment #38
Anonymous (not verified) commentedI am also having the same error message and a lot of blank nodes showing up the above fix in #30 gets rid of the error message but there are still lots of blank nodes showing up. The error came up after I upgraded Drupal to 5.17.
Comment #39
kenorb commentedGo to: #168045: fieldgroup.module error: Invalid Argument supplied for foreach()
Comment #40
Anonymous (not verified) commentedAgain that gets rid of the error but I am getting page not found left and right but when I search for the node in phpmyadmin the node and node revision both exist.
Comment #41
mofdi2 commentedin CCK filedgroup.module
replace
lign 394:
foreach ($group['fields'] as $field_name => $field) {
with:
if (!empty($group['fields'])) foreach ($group['fields'] as $field_name => $field) {
Comment #42
Anonymous (not verified) commentedSubscribing
P.S.:
not using Panels here
Comment #43
pbucalo commentedSubscribing