Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

services:
postgres:
image: postgres:15
image: postgres:16
env:
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
Expand All @@ -31,6 +31,18 @@ jobs:
fail-fast: false
matrix:
include:
- php: 8.4
moodle-branch: MOODLE_502_STABLE
database: pgsql
- php: 8.4
moodle-branch: MOODLE_502_STABLE
database: mariadb
- php: 8.3
moodle-branch: MOODLE_502_STABLE
database: pgsql
- php: 8.3
moodle-branch: MOODLE_502_STABLE
database: mariadb
- php: 8.4
moodle-branch: MOODLE_501_STABLE
database: pgsql
Expand Down
6 changes: 5 additions & 1 deletion classes/event_observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ public static function entry_modified(\core\event\base $event) {

// Changed from get_users_by_capability to get_enrolled_users to prevent site admins
// receiving notifications unless they are explicitly enrolled in the course.
$teachers = get_enrolled_users($context, 'mod/journal:manageentries', 0, 'u.id, u.email, u.lang, ' . $userfields);
// message_send() requires auth, suspended, deleted and emailstop on the recipient,
// and email_to_user() reads username, mailformat, maildisplay and mnethostid.
$requiredfields = 'u.id, u.auth, u.mnethostid, u.username, u.email, u.emailstop, '
. 'u.mailformat, u.maildisplay, u.lang, u.deleted, u.suspended';
$teachers = get_enrolled_users($context, 'mod/journal:manageentries', 0, $requiredfields . ', ' . $userfields);

if (empty($teachers)) {
return;
Expand Down
5 changes: 3 additions & 2 deletions classes/task/cron_task.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ public function execute() {
} else {
$usernamefields = get_all_user_name_fields();
}
$requireduserfields = 'id, auth, mnethostid, email, emailstop, mailformat, maildisplay, lang, deleted, suspended, '
. implode(', ', $usernamefields);
// Since Moodle 5.0, email_to_user() also reads username for its log context.
$requireduserfields = 'id, auth, mnethostid, username, email, emailstop, mailformat, maildisplay, '
. 'lang, deleted, suspended, ' . implode(', ', $usernamefields);

// To save some db queries.
$users = [];
Expand Down
5 changes: 3 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'mod_journal';
$plugin->version = 2026030700;
$plugin->version = 2026071700;
$plugin->requires = 2022041900; /* Moodle 4.0 */
$plugin->release = '5.1.3 (Build: 2026030700)';
$plugin->supported = [400, 502]; /* Moodle 4.0 - 5.2 */
$plugin->release = '5.1.4 (Build: 2026071700)';
$plugin->maturity = MATURITY_STABLE;