There are a couple of foreach() loops that don't test for valid arrays first, causing the following PHP warnings:

Warning: Invalid argument supplied for foreach() in webform_mollom_form_info() (line 3682 of sites/all/modules/contrib/webform/webform.module).
Warning: Invalid argument supplied for foreach() in webform_mollom_form_info() (line 3693 of sites/all/modules/contrib/webform/webform.module).

Simple fix, obviously. Patch to follow.

Comments

TravisCarden’s picture

Status:Active» Needs review
StatusFileSize
new4.08 KB
acbramley’s picture

This exists on 7.x-3.x branch too, rolled this patch for that.

TravisCarden’s picture

Version:6.x-3.x-dev» 7.x-3.x-dev
fenstrat’s picture

Thanks guys, but I can't replicate this. Is it happening on nodes with empty webforms? Patch looks fine, I'm just trying to understand when $node->webform['components'] and $node->webform['emails'] would not be set.

acbramley’s picture

Yeah a webform with no components or emails set is what causes it I believe

TravisCarden’s picture

Assigned:TravisCarden» Unassigned
quicksketch’s picture

Status:Needs review» Needs work

Hi guys, thanks for this patch. Another way to solve this problem is to simply not include nodes in webform_mollom_form_list() that don't have a record in the "webform" table, since we already keep that table clean of any nodes that don't have any components or e-mails. We did a similar fix in #1562756: Webform "admin/content/webform" page should only show nodes with webform configuration, not all webform-enabled types.

quicksketch’s picture

Status:Needs work» Needs review
StatusFileSize
new611 bytes
new623 bytes

Patches that take the approach suggested in #7.

quicksketch’s picture

Status:Needs review» Fixed

I went ahead and committed these patches. Please let me know if there are any further issues with the Mollom listing.

Status:Fixed» Closed (fixed)

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