Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mailable $locale does not serialize when queuing #23675

Closed
alshenetsky opened this issue Mar 23, 2018 · 1 comment
Closed

Mailable $locale does not serialize when queuing #23675

alshenetsky opened this issue Mar 23, 2018 · 1 comment

Comments

@alshenetsky
Copy link

alshenetsky commented Mar 23, 2018

  • Laravel Version: 5.6.12
  • PHP Version: 7.2.1
  • Database Driver & Version: MySQL 5.5.5

Description:

Ability to set locale on Mailables was added in #23178
But there is a bug:
The $locale variable in Mailable class does not serializes.

Steps To Reproduce:

  1. Make a Mailable class that implements ShouldQueue
  2. Set mailable locale in instance constructor or build() method:
    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
    	return $this->view('myview')->locale('lv');
    }

  1. Let it be queued

And now, if we look into serialized job, we will see:

s:6:\"locale\";N;

When job starts running, instance does not receive locale.

	/**
	 * Send the invoice.
	 *
	 * @param  \Illuminate\Contracts\Mail\Mailer  $mailer
	 * @return void
	 */
	public function send(MailerContract $mailer)
	{
		dd($this->locale); // NULL
	
	}
@themsaid
Copy link
Member

themsaid commented Apr 4, 2018

I can't replicate this, works fine for me.

@alshenetsky alshenetsky changed the title Mailable $locale does not serializes when queuing Mailable $locale does not serialize when queuing May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants