User tests: Successful: Unsuccessful:
Pull Request resolves #47256
Require the --live-site option when the Update Notification task is executed via CLI.
If the option is missing, the task logs a message and exits with Status::KNOCKOUT.
Status::KNOCKOUT and logs a message.Running the task via CLI without --live-site generates invalid URLs like:
https://joomla.invalid/set/by/console/application/
If --live-site is missing, the task logs a message and exits early.
If --live-site is provided, the task runs normally.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Front End Plugins |
| Title |
|
||||||
imho i'll don't want to be so strict if the
--live-siteisn't provided a warning is enough
Thanks for the feedback!
From my understanding of @bembelimen 's comment after the maintenance meeting, the idea was to require the --live-site option and return an error when it's missing.
Since the CLI environment doesn't know the site URL by default, I thought failing early would avoid generating invalid URLs like joomla.invalid.
But I'm happy to adjust it to just log a warning if you think that's the better approach.
I'm not a maintainer, I'm a volunteer like you, so I express my opinion and, in my humble opinion, it's better to have an update notification available, even with a wrong url inside the email, rather than not having it at all and a task error
As the update message without URL does not work, it's correct to give a proper log entry and a proper exit code and not executing the task any further.
This pull request has been automatically rebased to 6.2-dev.
| Title |
|
||||||
I have tested this item ✅ successfully on 2952afe
I have tested this item ✅ successfully on 2952afe
I have tested this item 🔴 unsuccessfully on 2952afe
I am on windows wampserve.
After applying the patch i do get a change but an error message
e:\wamp64\www\jpatch_6_02>php cli/joomla.php scheduler:run -i 3 --live-site http://127.0.0.1/api_6x
Run Tasks
=========
In provider.php line 43:
Call to undefined method Joomla\Plugin\Task\UpdateNotification\Extension\UpdateNotification::setMailerFactory()
scheduler:run [-i|--id ID] [--all] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--live-site [LIVE-SITE]] [--] <command>
This may be a error which can now be seen but has nothing to do with the PR.
By the way, where can i see wrong URLS ?
I have tested this item 🔴 unsuccessfully on 2952afe
I am on windows wampserve.
After applying the patch i do get a change but an error message
e:\wamp64\www\jpatch_6_02>php cli/joomla.php scheduler:run -i 3 --live-site http://127.0.0.1/api_6x
Run Tasks
=========
In provider.php line 43:
Call to undefined method Joomla\Plugin\Task\UpdateNotification\Extension\UpdateNotification::setMailerFactory()
scheduler:run [-i|--id ID] [--all] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--live-site [LIVE-SITE]] [--] <command>
This may be a error which can now be seen but has nothing to do with the PR.
By the way, where can i see wrong URLS ?
I have tested this item 🔴 unsuccessfully on 2952afeI am on windows wampserve. After applying the patch i do get a change but an error message
e:\wamp64\www\jpatch_6_02>php cli/joomla.php scheduler:run -i 3 --live-site http://127.0.0.1/api_6x Run Tasks ========= In provider.php line 43: Call to undefined method Joomla\Plugin\Task\UpdateNotification\Extension\UpdateNotification::setMailerFactory() scheduler:run [-i|--id ID] [--all] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--live-site [LIVE-SITE]] [--] <command>This may be a error which can now be seen but has nothing to do with the PR.
By the way, where can i see wrong URLS ?
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47374.
The invalid URL appears in the update notification email generated by the task. If the task runs without --live-site, Joomla falls back to https://joomla.invalid/..., so the link included in the email becomes invalid.
@Reda-Muhamed Tried to test with JBT Docker environment and seen before PR, but after PR I am getting red error
Call to undefined method Joomla\Plugin\Task\UpdateNotification\Extension\UpdateNotification::setMailerFactory()
And every minute an email like:
In provider.php line 43:
Call to undefined method Joomla\Plugin\Task\UpdateNotification\Extension\Up
dateNotification::setMailerFactory()
scheduler:run [-i|--id ID] [--all] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--live-site [LIVE-SITE]] [--] <command>
@Reda-Muhamed Without the new option the cli command fails. But why not have the old functionality and use the unusable URL if the parameter is missing? In this case old cronjobs entries without the new parameter will not fail and if you give the new --live-site parameter you will have the given site URL in the email.
@Reda-Muhamed Tried to test with JBT Docker environment and seen before PR, but after PR I am getting red error
Call to undefined method Joomla\Plugin\Task\UpdateNotification\Extension\UpdateNotification::setMailerFactory()And every minute an email like:
In provider.php line 43: Call to undefined method Joomla\Plugin\Task\UpdateNotification\Extension\Up dateNotification::setMailerFactory() scheduler:run [-i|--id ID] [--all] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--live-site [LIVE-SITE]] [--] <command>
That could possibly be caused by the rebase.
imho i'll don't want to be so strict if the
--live-siteisn't provided a warning is enough