mdjnelson / moodle-mod_customcert

Enables the creation of dynamically generated certificates with complete customisation via the web browser.
https://moodle.org/plugins/mod_customcert
GNU General Public License v3.0
89 stars 155 forks source link

Problem mod_customcert\task\email_certificate_task not send email #598

Closed MaurizioBelli closed 4 months ago

MaurizioBelli commented 5 months ago

My Moodle is unable to send certificates via email and returns the following problem:

Execute scheduled task: Gestisce l'invio dei certificati via email (mod_customcert\task\email_certificate_task) ... started 02:05:01. Current memory use 19.9 MB. Debugging increased temporarily due to faildelay of 86400 ... used 48 dbqueries ... used 0.16751909255981 seconds Scheduled task failed: Gestisce l'invio dei certificati via email (mod_customcert\task\email_certificate_task),È stato rilevato un errore di programmazione, deve essere sistemato da un programmatore: Context does not belong to any course. Backtrace:

In the scheduled activities I find: Gestisce l'invio dei certificati via email \mod_customcert\task\email_certificate_task | Certificato personalizzatomod_customcert |   |   | Mai | martedì, 23 gennaio 2024, 16:31 | | | | | * | 60Svuota | No

Can you help me? How can I solve it?

mdjnelson commented 4 months ago

Looks like there is a bug in Moodle or something strange going on with your Moodle site. Do you have any customisations? The error is coming from get_enrolled_users() which the certificate calls but it fails before it gets a result back which to me seems this is not an issue with the plugin. This will require someone debugging your code and seeing what they can do.

mdjnelson commented 4 months ago

Do a Google search for "Moodle Context does not belong to any course" and you will see some potentially helpful posts.