I get this error when updating a workflow status.
warning: Invalid argument supplied for foreach() in webform_confirm_email.module on line 29.
Drupal reports page said "Successfully sent email to me@society.fr" but i didn't receive anything.
Erratum: I receive emails
I also get a notice of type "DEBUG CONFIRM EM" and with message "email type:"

Comments

cocoggu’s picture

Status: Needs work » Patch (to be ported)
StatusFileSize
new12.31 KB

After some research, I find it was not because of workflow but because i send mail during workflow process.

So on line 29, foreach loop was trying to access to webform['emails'] which didn't exist in this case.

$mailarr=$message['params']['node']->webform['emails'];
  foreach($mailarr as $mailing){
    if ($mailing['email']==$message['to'])$eid=$mailing['eid'];
  }

So I test if this table was setted at the beginning of the webform_confirm_email_mail_alter function
Here is the new beginning of the function:

function webform_confirm_email_mail_alter(&$message) {
// If webform is not set, exit
	if(!isset($message['params']['node']->webform)) {
		return '';
	}
    list($email_type, $eid) = webform_confirm_email_get_email_info($message);

...

...and it works like a charm.

matthias_mo’s picture

Status: Patch (to be ported) » Closed (fixed)

please get the latest git version, the code has changed quite drastically since.

matthias_mo’s picture

Issue summary: View changes

Erratum about emails reception