User tests: Successful: Unsuccessful:
Pull Request for Issue #16093 .
Dont error if there is no from EMAIL in Joomla Global Config, when sending an email.
install Joomla 3.7.1
REMOVE the from name in your global configuration mail settings
Create a new Publisher using the admin console.
No email is sent, no PHP warning given.
0 Call to a member function addRecipient() on boolean
(Note: PR quickly created in Github, may need refining)
Status | New | ⇒ | Pending |
Category | ⇒ | Front End Plugins |
Title |
|
It fixes the reported issue, which is where there is no Mail From email address set in Joomla Global Config.
It doesn't attempt to fix the issues you are reporting ;-)
Are you advocating removing the "sexy way" of chaining the method calls when using phpMailer then?
It's twofold. You fix an obvious "if this field doesn't have an @
symbol then it's totally broken and can't work" issue. But if the supplied email address values fail PHPMailer's validation when adding addresses, then it will still break because setSender
and addRecipient
can both return either $this
or boolean false, the latter breaking the fluent interface.
So ya, you'd have to drop the "sexy" method chaining here.
ok thats an "in the office job" and not "in the hotel lobby drinking coffee" job :)
I have tested this item
No point testing @franz-wohlkoenig Im gonna improve this when I get to the office.
Labels |
Added:
?
|
I have now removed the fluent interface use of phpMailer calls, please test again.
Title |
|
Title |
|
||||||
Easy | No | ⇒ | Yes |
Title |
|
@PhilETaylor got different Info than before:
if this is correct, i set "sucessfully Test".
I can confirm the issue before the pr
but after applying the pr I just get the message user successfully saved - no warning or error
I have tested this item
thats the joy with php mail, it provides no feedback…
On 22 May 2017, at 19:16, Brian Teeman notifications@github.com wrote:
I have tested this item
? unsuccessfully on d861f6c d861f6c
This comment was created with the J!Tracker Application https://github.com/joomla/jissues at issues.joomla.org/tracker/joomla-cms/16107 https://issues.joomla.org/tracker/joomla-cms/16107.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #16107 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AAYa3HChRUrciKv6YLnGzvJKgqOZZjJ4ks5r8dEOgaJpZM4NfIBi.
i think i would prefer the ugly error message then from before the pr in that case. at least i know something has gone wrong then
You can check if setSender
and addRecipient
return a boolean false instead of ignoring the return in those cases. In theory, https://github.com/joomla/joomla-cms/pull/16107/files#diff-8b42e55d5e424b7f172d227f1a012e1dR167 should be reporting a sending failure but it might have to become a if ($mail->Send() !== true)
check (because IIRC that method can return boolean true, boolean false, or JException
).
I have tested this item
I have changed this PR so that we use JFactory::getMailer()->sendMail()
function instead, this handles all the if
statements already and so no need to repeat them, just consume the API.
@PhilETaylor need to test again?
Yes Please.
yes you need to test again as the code has changed
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-24 20:12:49 |
Closed_By | ⇒ | rdeutz | |
Labels |
Added:
?
|
Still doesn't fully fix it. If PHPMailer rejects the from or recipient addresses and returns a boolean false, it'll break the fluent interface.