- Issue created by @omsingh89
- ๐ฎ๐ณIndia prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
Prem Suthar โ made their first commit to this issueโs fork.
- Status changed to Needs review
5 months ago 10:54am 8 August 2024 - ๐ฎ๐ณIndia prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
I think So you need to just add the not empty Condition on the $builder Variable So when $builder is empty then skip the call of this line
$email = $builder->fromArray($this->emailFactory, $message);
.For This I have added The Mr.
- ๐ต๐นPortugal kallado
@prem suthar your solution
if (!$builder) {
$email = $builder->fromArray($this->emailFactory, $message);
}I haven't teste this but im pretty sure that if that condition is fulfiled (the $builder is NULL) you will have the same exact error.
"Call to a member function fromArray() on null"
This will also create another error in
if ($send) {
$message['result'] = $email->send();
}
Because the email won't be defined
I think we have to digg a littlle bit deeper and understant why the $buildr is NULL in the first place - ๐ต๐นPortugal kallado
Feals like in symfony_mailer/src/Processor/EmailBuilderManager.php
/**
* {@inheritdoc}
*/
public function createInstanceFromMessage(array $message) {
$this->buildCache();
$suggestions = [
"$message[module].$message[key]",
$message['module'],
];foreach ($suggestions as $plugin_id) {
if ($this->hasDefinition($plugin_id)) {
return $this->createInstance($plugin_id);
}
if ($override_id = $this->overrideMapping[$plugin_id] ?? NULL) {
return $this->createInstance($override_id);
}
}
}There is nothing being returned and that is what causes the issue. It might not be a issue with the module but in the way you're handaling the email.
- Status changed to Closed: duplicate
4 months ago 3:22pm 15 August 2024 - ๐ฌ๐งUnited Kingdom adamps
I guess this is a duplicate of โจ Handle case where hook_mail() does not exist Active