ical Notifications: Fix users to notify#708
Merged
smbader merged 1 commit intoncstate-delta:mainfrom Apr 16, 2026
Merged
Conversation
jrchamp
reviewed
Apr 9, 2026
| private function get_users_to_notify(int $zoomid, int $courseid) { | ||
| $cminfo = get_fast_modinfo($courseid)->instances['zoom'][$zoomid]; | ||
| $users = get_users_by_capability($cminfo->context, 'mod/zoom:view'); | ||
| $users = get_enrolled_users($cminfo->context, 'mod/zoom:view', 0, 'u.*', null, 0, 0, true); |
Collaborator
There was a problem hiding this comment.
In review: get_users_by_capability($context, $capability) and get_enrolled_users($context, $capability) only differ in that the latter also requires an enrollment in the course. The next four parameters have been set to the default. Only the final parameter is not default, setting $active to true, which excludes suspended and expired enrollments. The change overall thus requires active enrollments, which aligns with Moodle's stance that only active course participants should be notified about activity events (like forum posts).
Contributor
|
Hello Paul! This is a great contribution! The change looks good as well - we are going to do some quick testing and get this approved soon. Thank you so much! |
smbader
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Send ical notifications task: Fix users to notify.
Previously we made use of the 'get_users_by_capability', but we noticed that is not sufficient.
We copied a course that contained a zoom activity scheduled for a future time.
The copied course doesn't contain any user enrolments (we selected that option).
But then the ical notifications would still be sent to users with high-level capabilities in the copied course's zoom activity. This is incorrect since it should only be sent to users enrolled within the course.