Skip to content

Commit ac3f528

Browse files
committed
Fix filtering active users, use superusers as fallback, change description
1 parent 87dc805 commit ac3f528

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

administrator/components/com_joomlaupdate/src/Model/NotificationModel.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,12 @@ public function sendNotification($type, $oldVersion): void
4949
$params = ComponentHelper::getParams('com_joomlaupdate');
5050

5151
// User groups from input field
52-
$emailGroups = $params->get('automated_updates_email_groups');
52+
$emailGroups = $params->get('automated_updates_email_groups', $this->getSuperUserGroups(), 'array');
5353

5454
if (!\is_array($emailGroups)) {
5555
$emailGroups = ArrayHelper::toInteger(explode(',', $emailGroups));
5656
}
5757

58-
// Add Super User Groups
59-
$emailGroups = array_merge($emailGroups, $this->getSuperUserGroups());
60-
6158
// Get all users in these groups who can receive emails
6259
$emailReceivers = $this->getEmailReceivers($emailGroups);
6360

@@ -114,11 +111,12 @@ private function getEmailReceivers($emailGroups): array
114111
->getMVCFactory()->createModel('Users', 'Administrator');
115112

116113
$usersModel->setState('filter.groups', $emailGroups);
117-
$usersModel->setState('filter.block', (int) 0);
114+
$usersModel->setState('filter.state', (int) 0); // Only enabled users
118115

119116
$usersInGroup = $usersModel->getItems();
120117

121118
if (empty($usersInGroup)) {
119+
// Cannot happen, as at least one super user must exist in the system
122120
return [];
123121
}
124122

administrator/language/en-GB/com_joomlaupdate.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ COM_JOOMLAUPDATE_CONFIG_AUTOMATED_UPDATES_DISABLED_LABEL="<span class=\"fa-fw me
1616
COM_JOOMLAUPDATE_CONFIG_AUTOMATED_UPDATES_LABEL="Automated Updates"
1717
COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_DESC="Automatically update Joomla to the latest version when it is available."
1818
COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_LABEL="Automated Update"
19-
COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_UPDATE_EMAIL_DESCRIPTION="All Super Users and all users in the selected groups will receive the emails if they have the receive system emails option enabled in their user profile."
19+
COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_UPDATE_EMAIL_DESCRIPTION="All users in the selected groups will receive the emails if they have the receive system emails option enabled in their user profile. If no users are found, all super users will receive the emails."
2020
COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_UPDATE_EMAIL_LABEL="Send Email to User Groups"
2121
COM_JOOMLAUPDATE_CONFIG_BACKUPCHECK_DESC="Shows the checkbox to confirm you have taken a backup and you're ready to update in the final step before the update is actually applied."
2222
COM_JOOMLAUPDATE_CONFIG_BACKUPCHECK_LABEL="Confirm Backup Checkbox"

0 commit comments

Comments
 (0)