DevelMailLog extends PhpMail and this one implements MailInterface

Accord with the MailInterface, the function mail should return a boolean.

* @return bool
* TRUE if the mail was successfully accepted for delivery, otherwise FALSE.

But as far as I can see in the code, the DevelMailLog::mail method returns:

return file_put_contents($output_file, $output);

Which accord with PHP's documentation:

This function returns the number of bytes that were written to the file, or FALSE on failure.

So when the mail is sent instead to return true it returns a number which can be confused and is not following the interface.

I will provide a test and a patch in my next comment.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gnuget created an issue. See original summary.

gnuget’s picture

The last submitted patch, 2: 2848968-devel-test-only-2.patch, failed testing.

willzyx’s picture

Status: Needs review » Reviewed & tested by the community

  • moshe weitzman committed 13b7656 on 8.x-1.x authored by gnuget
    Issue #2848968 by gnuget: DevelMailLog doesn't respect the MailInterface
    
moshe weitzman’s picture

Status: Reviewed & tested by the community » Fixed

Thanks.

Status: Fixed » Closed (fixed)

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