Noticed this while using sfweb2lead_webform module - it doesn't define 'messages' or 'message' in its configuration for an SalesforceWebToLeadPostWebformHandler object (which overrides RemotePostWebformHandler), causing warnings in the log.

Notice: Undefined index: messages in Drupal\webform\Plugin\WebformHandler\RemotePostWebformHandler->getCustomResponseMessage() (line 1079 of /var/www/drupal/web/modules/contrib/webform/src/Plugin/WebformHandler/RemotePostWebformHandler.php)
Warning: Invalid argument supplied for foreach() in Drupal\webform\Plugin\WebformHandler\RemotePostWebformHandler->getCustomResponseMessage() (line 1079 of /var/www/drupal/web/modules/contrib/webform/src/Plugin/WebformHandler/RemotePostWebformHandler.php)

As far as I can tell, a child class isn't "required" to set or override these parameters. The existence of 'message' is checked for, but 'messages' is not. The attached patch fixes this assumption.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cpigott created an issue. See original summary.

jrockowitz’s picture

Status: Active » Needs review
FileSize
0 bytes

Here is one minor tweak.

jrockowitz’s picture

  • jrockowitz authored dfb86a8 on 8.x-5.x
    Issue #3137625 by jrockowitz, cpigott: Notice: Undefined index: messages...
jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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