User tests: Successful: Unsuccessful:
Pull Request for Issue (#45685 (comment)).
Change this PR to configure user group(s) (like for the standard task operations) instead of having an input field for email addresses.
As suggested. Every user who is not blocked and has a valid email address can receive a notification. The user must be in a user group which can be selcted in the form.
Make one or more user groups with different users in different userGroups. Play around wit empty groups, blocked users ..
Add / remove / change selected user groups in the automated update configuration.
Check if all and only users with valid email-address and permission to receive system emails get the email after autoUpdate.
To check the email address there is a quick and dirty workaround for testing the sendNotification method without the automated update.
Add this into any displayContoller.php, for example com_content:
https://github.com/joomla/joomla-cms/blob/5.4-dev/administrator/components/com_content/src/Controller/DisplayController.php#L61
// Testonly sendNotification
$notificationModel = \Joomla\CMS\Factory::getApplication()->bootComponent('com_joomlaupdate')
->getMVCFactory()->createModel('Notification', 'Administrator');
$notificationModel->sendNotification('update', '5.3.0');
Then go to a view of that component in backend. foe example content - Articles.
You can check the email-addresses here:
administrator\components\com_joomlaupdate\src\Model\NotificationModel.php after line 62.
Simple code if you don't use xdebug:
// Debugging output
echo '<pre>';
echo htmlspecialchars(print_r($emailReceivers, true));
echo '</pre>';
exit;
The input form for the Plugin
The output:
All super users and all users from the input who are not blocked and have senMail = 1 are listed, only one times.
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_joomlaupdate Language & Strings |
Labels |
Added:
Language Change
PR-5.4-dev
|
Labels |
Added:
Feature
|
Title |
|
@chmst thank you for the PR, I have setup the multiple User Groups and am stuck at the:
"Check if all and only users with valid email-address and permission to receive system emails get the email after autoUpdate."
how do I 'trigger' the autoUpdate? ( I tried the run the scheduled task Update Notification manually but that did nothing, so I am forgetting, missing or not grasping something ).
I tried the run the scheduled task Update Notification manually but that did nothing,
that wont as its not related to this PR - confusing I know but we now have two different systems that can send an email about updates - and with different settings
how do I 'trigger' the autoUpdate?
@exlemor You trigger Automated Updates in testing environment with:
@chmst I have tested this PR with:
An error has occurred.
0 Cannot instantiate abstract class Joomla\Module\Latest\Administrator\Helper\LatestHelper
I am asking me, can we test this PR this way? Or do we need to create an update package from this PR and use it on alpha update server, since the update overwrites this PR and the emails may only be sent after the update?
I am asking me, can we test this PR this way? Or do we need to create an update package from this PR and use it on alpha update server, since the update overwrites this PR and the emails may only be sent after the update?
I think that is exactly the problem.
It is a problem and I did not test the AutoUpdater itself.
I thought, you all can test the AutoUpdate, it is just me who needs a trick ^^.
To check the email address I had a quick and dirty workaound for testing:
I added a piece of code into the com_joomlaupdate displayController to call the sendNotification Method
public function display($cachable = false, $urlparams = false)
{
// Get the document object.
$document = $this->app->getDocument();
// Testonly sendNotification
$notificationModel = \Joomla\CMS\Factory::getApplication()->bootComponent('com_joomlaupdate')
->getMVCFactory()->createModel('Notification', 'Administrator');
$notificationModel->sendNotification('update', '5.3.0');
//Testonly
Now could play around with userGroups and users in the automated update screen.
When you click save or anything else, the controller calls the sendNotification Method..
Add a simple echo into the notificationModel Model - sendNotification method, you can see which users are the $emailReceiver list.
To make it quite clear: I did not test the AutoUpdate itself.
IIf this can be tested, the notification in the uppdateNotification Plugin can be made i the same way
It is possible to find all users with core.admin right, these are the super users.
There are two options for receivers:
I implement now the second option.
All super users AND all users in defined user groups get an email (if they are active and have sendEmail "on").
This is easier to explain and understand
Test instructions for testing only the sendNotification method, not the update!
Add this into any displayContoller.php, you can use com_content (and remove it after test).
` // Testonly sendNotification
$notificationModel = \Joomla\CMS\Factory::getApplication()->bootComponent('com_joomlaupdate')
->getMVCFactory()->createModel('Notification', 'Administrator');
$notificationModel->sendNotification('update', '5.3.0');
//Testonly`
@chmst I've allowed myself to copy a part of the instructions in your comment here #45721 (comment) to the testing instructions so testers find it. Please modify if necessary.
The Testing instructions lack the exact location where to insert the workaround.
The Testing instructions lack the exact location where to insert the workaround.
@dautrich Sorry, that was my mistake when helping with copying the information from a later comment into the testing instructions. I have forgotten some part. I've just updated the instructions. Can you check again? Is it clear enough now? Thanks in advance.
Labels |
Added:
PBF
|
It still should check for Users with
sendEmail = 1
("Receive System Emails" parameter). Please keep that.