User tests: Successful: Unsuccessful:
Pull Request for Issue # .
This PR prevents the execution of the relative to absolute URL conversation for Mail Templates when in CLI mode because this method uses (J)Uri which tries to load the URL from the server:
So sending mail templates in the cli does not work properly
Open libraries/src/Console/SiteDownCommand.php
Line 97 and add:
$mailtemplate = new \Joomla\CMS\Mail\MailTemplate('com_contact.mail', 'en-GB');
$mailtemplate->addRecipient('test@example.com');
$mailtemplate->send();
exit;
open the terminal/cmd/powershell, navigate to your joomla folder and run:
php cli/joomla.php site:down
PHP Warning: Undefined array key "HTTP_HOST" in libraries/src/Uri/Uri.php on line 103
No warning
Status | New | ⇒ | Pending |
Title |
|
Category | ⇒ | Libraries |
It still does not work, not because of the live site (this makes it nearly work) but because of the isSsl check line 143 (Uri.php) and getting the server instance above it outputs the warning...
I understand what he's saying - the ssl detection also fails - because it still tries to parse the site to determine that. even if you used global config force ssl (which although it could be coded to work - not all sites even have ssl - and others will have had it setup with nginx/apache from the start without the joomla params - and we need to not hard fail on those sites).
This pull requests has been automatically converted to the PSR-12 coding standard.
Labels |
Added:
?
?
|
This pull request has been automatically rebased to 4.3-dev.
Title |
|
This pull request has been automatically rebased to 4.4-dev.
Testers beware: you can only test this issue if you have a (local) mail server! (which I don't)
I have tested this item ? unsuccessfully on 0799bdd
I added the code to line 102 (has changes since instructions were written) of a J4.4.3 installation. Ran the site:down command and did not get an error. So can't replicate the issue.
I have tested this item ? unsuccessfully on 0799bdd
I've tested this issue on Joomla! 4.4.3
There is no difference before and after the patch
After php cli/joomla.php site:down
the CLI states:
Site Offline
and I received an email (on local system using Mailhog) with non translated language strings:
Subject COM_CONTACT_ENQUIRY_SUBJECT
To "test@example.com" test@example.com
Plain text
COM_CONTACT_ENQUIRY_TEXT
Title |
|
This pull request has been automatically rebased to 5.2-dev.
Title |
|
I think it's more complicated than this I'm afraid. Because if you have the
live_site
parameter set in global config then this would work. We also probably want it to work when in CLI too...