Received this error when submitting a form:

Warning: Invalid argument supplied for foreach() in Drupal\sfweb2lead_webform\Plugin\WebformHandler\SalesforceWebToLeadPostWebformHandler->getRequestData() (line 168 of modules/contrib/sfweb2lead_webform/src/Plugin/WebformHandler/SalesforceWebToLeadPostWebformHandler.php).

Checking if custom data exists first solves the issue.

Comments

a3hill created an issue. See original summary.

a3hill’s picture

maursilveira’s picture

Status: Active » Reviewed & tested by the community

Patch #2 is simple, concise and works just fine.

Thank you, @a3hill!

capysara’s picture

Patch in #2 resolved the issue. Thanks!

  • AaronBauman committed 2c9d6b5 on 8.x-5.x authored by a3hill
    Issue #3101911 by a3hill: Invalid argument supplied for foreach() when...
aaronbauman’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks for the patch.
New release coming shortly

Status: Fixed » Closed (fixed)

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