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.
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
Comment #1
TravisCarden CreditAttribution: TravisCarden commentedComment #2
acbramley CreditAttribution: acbramley commentedThis exists on 7.x-3.x branch too, rolled this patch for that.
Comment #3
TravisCarden CreditAttribution: TravisCarden commentedComment #4
fenstratThanks 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.
Comment #5
acbramley CreditAttribution: acbramley commentedYeah a webform with no components or emails set is what causes it I believe
Comment #6
TravisCarden CreditAttribution: TravisCarden commentedComment #7
quicksketchHi 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.Comment #8
quicksketchPatches that take the approach suggested in #7.
Comment #9
quicksketchI went ahead and committed these patches. Please let me know if there are any further issues with the Mollom listing.