sashas777 / bug-from-email

Fix for Magento 2.2.4 GitHub Issue #14952 (https://github.com/magento/magento2/issues/14952)
35 stars 16 forks source link

Fatal error after installation #2

Closed mariamghalleb closed 6 years ago

mariamghalleb commented 6 years ago

Hello , I'm on magento 2.2.4, php 7. I got this right after enabling the module, please see attached.

capturesa

sashas777 commented 6 years ago

@mariamghalleb

Can you please show what is your deploy mode?

bin/magento deploy:mode:show

Did you do composer installation or what steps to follow in order to repeat it?

mariamghalleb commented 6 years ago

i'm on a developer mode, and i didn't composer install, i copied the "module" manually

sashas777 commented 6 years ago

@mariamghalleb

Can you try to install it using composer, please? It will get the latest version of the module

composer require sashas/bug-from-email
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
mariamghalleb commented 6 years ago

I'm sorry I can't, I manually edited SenderBuilder.php and fixed the issue, thank you for your help though!

sashas777 commented 6 years ago

@mariamghalleb

Can you share what did you edit? Maybe it would help others?

Thanks

mariamghalleb commented 6 years ago

A simple fix instead of installing a module is to do like below until fixed in next release:

Goto >. ..../vendor/magento/module-sales/Model/Order/Email/SenderBuilder.php Edit the configureEmailTemplate() function and add this line $this->transportBuilder->setFrom($this->identityContainer->getEmailIdentity());

The function has to be as follows:

protected function configureEmailTemplate()
{
$this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
$this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
$this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
$this->transportBuilder->setFrom($this->identityContainer->getEmailIdentity());
//the below are commented
//$this->transportBuilderByStore->setFromByStore(  
//    $this->identityContainer->getEmailIdentity(), 
//    $this->identityContainer->getStore()->getId() 
// );
}

Credit to https://github.com/msawyers.

sashas777 commented 6 years ago

@mariamghalleb

Thanks

mariamghalleb commented 6 years ago

thanks to you too !