Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I just noticed that when I go to my Mollom settings that I get the following warning
"warning: Invalid argument supplied for foreach() in /home/public_html/sites/all/modules/mollom/mollom.module on line 1785."
From what I can tell, it might have something to do with cycling through CCK fields.
Comment | File | Size | Author |
---|---|---|---|
#31 | mollom.orphan.31.patch | 8.42 KB | sun |
#30 | mollom.orphan.30.patch | 7.25 KB | sun |
#29 | mollom.orphan.29.patch | 8.21 KB | sun |
#26 | mollom.deleted-forms.26.patch | 1.81 KB | sun |
#22 | mollom.deleted-forms.22.patch | 1.78 KB | sun |
Comments
Comment #1
sunHm, that's the foreach line in
However, looking at CCK's _content_type_info() function, I fail to see how the 'fields' key could ever be not an array.
Do you have any special modules and/or versions and/or patches installed?
Comment #2
Starminder CreditAttribution: Starminder commentedSubscribe - getting the same thing here
Comment #3
kirkcaraway CreditAttribution: kirkcaraway commentedSame error showing up here as well. Subscribing
Comment #4
sunThanks for subscribing. However, we need more debugging info in order to be able to replicate this bug. Any information you can provide would helpful. Starting from your Drupal core version, potentially applied patches, the version of CCK and Mollom modules, links to any applied patches for them, your web server + version, the version of PHP, the list of other installed/enabled modules, aso.
Comment #5
Starminder CreditAttribution: Starminder commentedI was getting it in offline mode for what's it worth.
Comment #6
sparkymark CreditAttribution: sparkymark commentedme too
Comment #7
sun- What kind of an "offline mode"?
- Do you get the same error message as the original poster?
- Do you have a content type that does not use any CCK fields?
Comment #8
Starminder CreditAttribution: Starminder commented- "Maintenance Mode"
- Yes, exactly the same error
- That's a good question, most of mine got updated to include this or that along the way.
Comment #9
sunAlthough it is technically impossible, here is a patch to avoid this error.
Comment #10
sunmeh.
Comment #11
sun#9: mollom-DRUPAL-6--1.cck_.9.patch queued for re-testing.
Comment #12
Dries CreditAttribution: Dries commentedNot going to commit this -- we need to figure out the real bug IMO.
Comment #15
Dave ReidI'm also able to reproduce this PHP notice, and I *do* have a anonymous user record in {users}.
Comment #16
Dave ReidI have this figured out. I had deleted a content type, but the record for the node type form is still in {mollom_form}. So now when I try to load the admin page, we're trying to invoke cck details about a node type that does not exist. There seems to be no handling of hook_node_type('delete') to clean up when node types are deleted. Once I removed the record from {mollom_form} the PHP notice went away.
Comment #17
Dave ReidRetitling
Comment #18
rootworkSo, was this ever committed?
Comment #19
yktdan CreditAttribution: yktdan commentedUpgraded from 1.16 to 2.1 and bug still there. I have probably deleted content types at some point.
Comment #20
rootworkyktdan, does it give the same line number as the original bug?
I'm changing the version based on your report to see if this can get more attention, but additional data from you would be helpful to confirm that this bug is still active in the 2.x branch.
Comment #21
yktdan CreditAttribution: yktdan commentedYes different line numbers on 2.1
warning: Invalid argument supplied for foreach() in /home/nynjtc/public_html/sites/all/modules/mollom/mollom.module on line 2576.
warning: Invalid argument supplied for foreach() in /home/nynjtc/public_html/sites/all/modules/mollom/mollom.module on line 2576.
warning: Invalid argument supplied for foreach() in /home/nynjtc/public_html/sites/all/modules/mollom/mollom.module on line 2576.
warning: Invalid argument supplied for foreach() in /home/nynjtc/public_html/sites/all/modules/mollom/mollom.module on line 2576.
warning: Invalid argument supplied for foreach() in /home/nynjtc/public_html/sites/all/modules/mollom/mollom.module on line 2576.
warning: Invalid argument supplied for foreach() in /home/nynjtc/public_html/sites/all/modules/mollom/mollom.module on line 2576.
warning: Invalid argument supplied for foreach() in /home/nynjtc/public_html/sites/all/modules/mollom/mollom.module on line 2576.
warning: Invalid argument supplied for foreach() in /home/nynjtc/public_html/sites/all/modules/webform/webform.module on line 3682.
warning: Invalid argument supplied for foreach() in /home/nynjtc/public_html/sites/all/modules/webform/webform.module on line 3693.
warning: Invalid argument supplied for foreach() in /home/nynjtc/public_html/sites/all/modules/mollom/mollom.module on line 2576.
warning: Invalid argument supplied for foreach() in /home/nynjtc/public_html/sites/all/modules/mollom/mollom.module on line 2576.
Comment #22
sunAttached patch does not automatically clean up forms that have vanished or been deleted, but at least it improves the error reporting on Mollom's form listing page.
In D7, the handling for vanished/deleted forms has been improved already. In D6, the general APIs provided by Drupal core do not really allow for sophisticated maintenance of configuration references.
In any case, I consider this patch just as a first step. If it comes back green, I'm planning to commit to it soonish.
Comment #24
Max_Headroom CreditAttribution: Max_Headroom commented#22: mollom.deleted-forms.22.patch queued for re-testing.
Comment #26
sunComment #28
sun#26: mollom.deleted-forms.26.patch queued for re-testing.
Comment #29
sunFurther investigation revealed that #2039155: Notice: Trying to get property of non-object in node_mollom_form_info() was a duplicate of this issue.
Attached patch merges both approaches + ensures that the code base between D7 and D6 stays synced.
Comment #30
sunwhoopsie ;)
Comment #31
sunBackported to D6.
Comment #32
sunThanks for reporting, reviewing, and testing! Committed to all branches.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.