Flynsarmy/laravel-db-blade-compiler

quoted_printable_encode() expects parameter 1 to be string, array given

edwinricaurte opened this issue · 3 comments

After upgrade to Laravel 5.6, the system stopped working.

quoted_printable_encode() expects parameter 1 to be string, array given

/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php

public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0)
{
    if ($this->charset !== 'utf-8') {
        throw new RuntimeException(
            sprintf('Charset "%s" not supported. NativeQpContentEncoder only supports "utf-8"', $this->charset));
    }

    **return $this->standardize(quoted_printable_encode($string));**
}
xUJYx commented

I have same problem on laravel 5.8 when using swiftmailer.
swiftmail_error
Content of the string when error triggered is empty array
error_array_output
If I transform empty array to empty string e-mail sending starts to work
transfer_empty_array_to empty_string
Mail starts to send with correct "address", "from", "subject", but without e-mail body...

Interesting things...

xUJYx commented

I found it!!!

In new versions of laravel 5.6+ they moved call of call_user_func in /vendor/laravel/framework/src/Illuminate/Mail/Mailer.php in send($view, array $data = [], $callback = null) method...
swiftmailer_error_point
If you move it back as in previous laravel versions - problem will be solved!!!
swiftmail_error_solved

Thanks! I had same problem and this fixes it.
I am using Laravel 8.1 and the error is still there, ... so I hope there is also some other solution (without overriding vendor code)