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.

Files: 
CommentFileSizeAuthor
#31 mollom.orphan.31.patch8.42 KBsun
PASSED: [[SimpleTest]]: [MySQL] 5,809 pass(es).
[ View ]
#30 mollom.orphan.30.patch7.25 KBsun
PASSED: [[SimpleTest]]: [MySQL] 6,477 pass(es).
[ View ]
#29 mollom.orphan.29.patch8.21 KBsun
PASSED: [[SimpleTest]]: [MySQL] 6,137 pass(es).
[ View ]
#26 mollom.deleted-forms.26.patch1.81 KBsun
PASSED: [[SimpleTest]]: [MySQL] 6,149 pass(es).
[ View ]
#22 mollom.deleted-forms.22.patch1.78 KBsun
FAILED: [[SimpleTest]]: [MySQL] 5,956 pass(es), 1 fail(s), and 0 exception(s).
[ View ]
#9 mollom-DRUPAL-6--1.cck_.9.patch1.16 KBsun
PASSED: [[SimpleTest]]: [MySQL] 1,500 pass(es).
[ View ]

Comments

Status:Active» Postponed (maintainer needs more info)

Hm, that's the foreach line in

<?php
function node_mollom_form_info($form_id) {
...
 
// Add CCK fields by default.
 
if (module_exists('content')) {
   
$content_info = content_types($type->type);
    foreach (
$content_info['fields'] as $field_name => $field) {
     
// We only consider text fields for text analysis.
     
if ($field['type'] == 'text') {
       
$form_info['elements'][$field_name] = check_plain(t($field['widget']['label']));
      }
    }
  }
?>

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?

Subscribe - getting the same thing here

Same error showing up here as well. Subscribing

Thanks 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.

I was getting it in offline mode for what's it worth.

me too

- 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?

- "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.

Status:Postponed (maintainer needs more info)» Reviewed & tested by the community
StatusFileSize
new1.16 KB
PASSED: [[SimpleTest]]: [MySQL] 1,500 pass(es).
[ View ]

Although it is technically impossible, here is a patch to avoid this error.

Version:6.x-1.13» 6.x-1.x-dev

meh.

#9: mollom-DRUPAL-6--1.cck_.9.patch queued for re-testing.

Status:Reviewed & tested by the community» Postponed (maintainer needs more info)

Not going to commit this -- we need to figure out the real bug IMO.

Status:Postponed (maintainer needs more info)» Active

I'm also able to reproduce this PHP notice, and I *do* have a anonymous user record in {users}.

I 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.

Title:Warning in Mollom settingsMollom does not clean up after deleted content types

Retitling

So, was this ever committed?

Upgraded from 1.16 to 2.1 and bug still there. I have probably deleted content types at some point.

Version:6.x-1.x-dev» 6.x-2.1

yktdan, 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.

Yes 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.

Title:Mollom does not clean up after deleted content typesDeleted forms of other modules are not cleaned up
Version:6.x-2.1» 6.x-2.x-dev
Status:Active» Needs review
StatusFileSize
new1.78 KB
FAILED: [[SimpleTest]]: [MySQL] 5,956 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Attached 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.

Status:Needs review» Needs work

The last submitted patch, mollom.deleted-forms.22.patch, failed testing.

Status:Needs work» Needs review

#22: mollom.deleted-forms.22.patch queued for re-testing.

Status:Needs review» Needs work

The last submitted patch, mollom.deleted-forms.22.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new1.81 KB
PASSED: [[SimpleTest]]: [MySQL] 6,149 pass(es).
[ View ]

Status:Needs review» Needs work

The last submitted patch, mollom.deleted-forms.26.patch, failed testing.

Status:Needs work» Needs review

#26: mollom.deleted-forms.26.patch queued for re-testing.

Title:Deleted forms of other modules are not cleaned upOrphan forms of other modules cause errors on administration page
Version:6.x-2.x-dev» 7.x-2.x-dev
StatusFileSize
new8.21 KB
PASSED: [[SimpleTest]]: [MySQL] 6,137 pass(es).
[ View ]

Further 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.

StatusFileSize
new7.25 KB
PASSED: [[SimpleTest]]: [MySQL] 6,477 pass(es).
[ View ]

-  function testFormFieldsConfiguration() {
+  function xtestFormFieldsConfiguration() {

whoopsie ;)

Version:7.x-2.x-dev» 6.x-2.x-dev
StatusFileSize
new8.42 KB
PASSED: [[SimpleTest]]: [MySQL] 5,809 pass(es).
[ View ]

Backported to D6.

Version:6.x-2.x-dev» 7.x-2.x-dev
Status:Needs review» Fixed

Thanks 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.

Status:Fixed» Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.