When the PHPMailer class is instantiated, it is done so without any arguments.
Which leads to PHPMailer echoing all errors. This will in turn break a batch process where the error corrupts the json the batch is expecting to see.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thomasth’s picture

rossb89’s picture

I just ran into this issue myself, and took a while to work out that the 'true' parameter is required to get the exceptions to be thrown so we can catch them.

Guess this isn't an issue many people run into, but it certainly affected me.

DamienMcKenna’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs review

Don't forget to set the issue status to "needs review" when you add a patch.

Status: Needs review » Needs work

The last submitted patch, 1: use_exceptions_phpmailer-2358001-0.patch, failed testing.

DamienMcKenna’s picture

Status: Needs work » Needs review
FileSize
1.85 KB

How about making it optional?

Anonymous’s picture

Looks good to me.

rossb89’s picture

Haven't tested this new version of the patch, but I agree, probably makes more sense to have this optional :)

DamienMcKenna’s picture

@wundo: I think this one should be safe to include in 1.4.

DamienMcKenna’s picture

Rerolled, because of the new variable in hook_uninstall.

bkosborne’s picture

Re-rolled.

However, I don't think this is valid anymore. I looked at the few places that PHPMailer actually uses this variable to handle exceptions/logging, and in no cases is it just "echoing" the error. It will either throw an exception or it will call Drupal's watchdog function. Perhaps when this issue was created 2 years ago, the version of PHPMailer that was used with the module was different?

tapaswini sahoo’s picture

Assigned: Unassigned » tapaswini sahoo
tapaswini sahoo’s picture

Assigned: tapaswini sahoo » Unassigned
FileSize
2.41 KB

i applied interdiff on this two patch.