Closed Apsimiegojas closed 1 month ago
Thanks for the thorough report. Would you be able to comment on MDL-79174, or even better create a new issue on tracker.moodle.org? It would save me the time trying to go through the code and understand what has happened vs what should happen.
I created new issue: https://tracker.moodle.org/browse/MDL-81850
Thank you @Apsimiegojas. :)
Closing as this is a bug in Moodle which will be fixed soon. See the Moodle tracker above for more information. Thanks again @Apsimiegojas.
After moodle recent update, scheduled task for emailing certificates does not work correctly with group restriction.
Steps to reproduce.
create certificate activity with option "Email students" set to Yes. Restrict access to group.
Add students to course and assign them same group as in step 1.
run cron
Expected result: certificate is sent to students Result: nothing happens.
I looked through recent changes and found out that this issue broke functionality: [MDL-79174] (https://tracker.moodle.org/browse/MDL-79174 )
Moodle incorrectly checks in which groups user is. Therefore group restriction does not work and $cm->uservisible returns incorrect value.
Proposed solution: Set global $USER value to user for which we are checking visibility Or report it to Moodle and wait for a fix.