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.
The PR fixes the hard coded default super user group = 8 for notifications, it gets all super user groups from assets.
Every user who is not blocked and has permission "sendEmail" and has a valid email address can receive a notification.
The user must be in a user group which can be selected in the form.
If there is no input in the field or if the selected groups are empty, all active super users get a notification.
Make one or more user groups with different users.
User can have senEmali Options or not, can be blocked or not, can be super users or not.
Play around with 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.
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 in the display method.
// Testonly sendNotification
$notificationModel = \Joomla\CMS\Factory::getApplication()->bootComponent('com_joomlaupdate')
->getMVCFactory()->createModel('Notification', 'Administrator');
$notificationModel->sendNotification('success', '5.4.115' , '5.4.116');
Then go to a view of that component in backend. This acrivate the sendNotification Method.
You can check the email-addresses here:
administrator\components\com_joomlaupdate\src\Model\NotificationModel.php befor the messages are sent:
Simple code snippet if you don't use xdebug:
// Debugging output
echo '<pre>';
echo htmlspecialchars(print_r($emailReceivers, true));
echo '</pre>';
exit;
The output:
All depends on the input and on the differen users configuration. All users from the input who are not blocked and have sendMail = 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
|
Labels |
Removed:
PBF
|
After sone discussions I changed the behaviour:
All users in selected groups receive a notification IF they are active users and IF they have permission "sendEmail". They must not have super user permission.
If the groups have no users or if nothing is selected, all super users get an email (fallback)
@rbuelund Any user who has the "Recieve System Emails" enabled, regardless if the users Group (Not a super user group) is selected or not in "Send Email to User Group" recieves an Email
This is intended behaviour. Also users who are not super users can receive emails for updates.
Tha use case is: there could be a customer who wants to be informed when his site is updated, but does not have super user permissions.
Or did I unterstand wrong?
They must not have super user permission
Why not?
The use case is: there could be a customer who wants to be informed when his site is updated, but does not have super user permissions
In small and private sites the whole feature will be "inform the one and only super user". In bigger companies this could be different.
They must not have super user permission
@brianteeman I think that is a typical German translation issue, and she meant not "must not" (German: "darf nicht") but "do not need to have" (German: "müssen nicht ... haben").
@chmst Can you confirm my assumption?
How embarassing! Thank you @richard67!
So - just to be shure. If no user Groups are selected and no Super Users have the "Recieve System Emails" enabled - then no e-mails are send? I have sites with maybe two Super Users where one should not recieve e-mails and the other should.
Can you please update the original description to show the current expected behaviour of this pr
I updated already.
@rbuelund
The correct usage would be making a usergroup with only the superuser(s) who receive the notifications.
This group can contain only one super user.
"All super users" is the fallback if nothing else is defined or if the selected usergroup has no members who can receive emails.
Thank you @chmst for your work. First test without settings successful, the initial super user email is shown. Second test failed. I created users heiko and christiane, assigned group Update-To-Be-Informed, configured only this group in Automated Updates. The list contains us, but also the super user email.
I have tested this item ✅ successfully on bc99f0b
Tested with manual installation as public available site (to be able to activate Automated Updates)
components/com_content/src/Controller/DisplayController.php
at start of display()
administrator/components/com_joomlaupdate/src/Model/NotificationModel.php
in sendNotification()
before // Send emails to all receivers
administrator/logs/*
and PHPI have tested this item ✅ successfully on bc99f0b
I have done more or less the same tests as @muhme
I have tested this item ✅ successfully on bc99f0b
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
RTC
|
Every user who is not blocked and has permission "sendEmail" and has a valid email address can receive a notification.
is their an email validation check or did you just mean "obviously if the email address is invalid then they wont receive the email"
Every user who is not blocked and has permission "sendEmail" and has a valid email address can receive a notification.
is there an email validation check or did you just mean "obviously if the email address is invalid then they wont receive the email"
As the last change was just a code comment clarification, the PR doesn't require new tests, and RTC is still valid.
Every user who is not blocked and has permission "sendEmail" and has a valid email address can receive a notification.
is there an email validation check or did you just mean "obviously if the email address is invalid then they wont receive the email
There is a email validation check.
The address is checked when a user is saved - but just in case.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-08-28 13:47:56 |
Closed_By | ⇒ | muhme |
Thank you @chmst for your contribution. Thank you @brianteeman, @richard67, @Fedik and @HLeithner for supporting. Thank you @exlemor and @rbuelund for testing.
The test was repeated w/o the given workaround as Alpha (Test) Automated Updates package 5.4.115 with joomla-5.4.0-beta2, with this PR included, is available now. Slightly modified with taking file and database dump after the configuration, checking log files after installation and unregistered from Automated Updates. Recreated from file and database dump for next test.
✅ Running Automated Update 7 (seven) times and checked the email received as specified 👍 😄
It still should check for Users with
sendEmail = 1
("Receive System Emails" parameter). Please keep that.