If test.names in the webform settings is empty, $this->names in WebformSubmissionGenerate.php will return NULL:

$this->names = Yaml::decode($this->configFactory->get('webform.settings')->get('test.names') ?: '');

This results in a PHP warning WARNING Invalid argument supplied for foreach() on the foreach ($this->names as $key => $values) {...} in the same file.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

matthiasm11 created an issue. See original summary.

matthiasm11’s picture

Assigned: matthiasm11 » Unassigned
Status: Active » Needs review
FileSize
699 bytes

Patch attached.

jrockowitz’s picture

Version: 6.0.0 » 8.x-5.x-dev

This should also be fixed 8.x-5.x

jrockowitz’s picture

Slightly different approach.

matthiasm11’s picture

Status: Needs review » Reviewed & tested by the community

That will work too, thanks for your quick response!

  • jrockowitz authored bc37d19 on 8.x-5.x
    Issue #3193872 by matthiasm11, jrockowitz: WebformSubmissionGenerate...

  • jrockowitz authored bc37d19 on 6.x
    Issue #3193872 by matthiasm11, jrockowitz: WebformSubmissionGenerate...
jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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