Hit a cron error where a course has deleted a gradeitem, and not updated their cert. This is blocking the cron task from finishing fully.
0007fc840fa5:27510 2024-01-07 19:50:58 Scheduled task failed: Handles emailing certificates. (mod_customcert\task\email_certificate_task),Call to a member function get_name() on bool
0007fc840fa5:27510 2024-01-07 19:50:58 Backtrace:
0007fc840fa5:27510 2024-01-07 19:50:58 * line 76 of /mod/customcert/element/gradeitemname/classes/element.php: call to customcertelement_gradeitemname\element->get_grade_item_name()
0007fc840fa5:27510 2024-01-07 19:50:58 * line 363 of /mod/customcert/classes/template.php: call to customcertelement_gradeitemname\element->render()
0007fc840fa5:27510 2024-01-07 19:50:58 * line 195 of /mod/customcert/classes/task/email_certificate_task.php: call to mod_customcert\template->generate_pdf()
0007fc840fa5:27510 2024-01-07 19:50:58 * line 309 of /lib/cronlib.php: call to mod_customcert\task\email_certificate_task->execute()
0007fc840fa5:27510 2024-01-07 19:50:58 * line 120 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
0007fc840fa5:27510 2024-01-07 19:50:58 * line 73 of /lib/cronlib.php: call to cron_run_scheduled_tasks()
0007fc840fa5:27510 2024-01-07 19:50:58 * line 178 of /admin/cli/cron.php: call to cron_run()
0007fc840fa5:27510 2024-01-07 19:50:58
I can see in other locations such as the date element fetching the gradeitem is done via element helper which returns a false, but in the gradeitemname element its direct fetched using the API, but not checked if its missing.
The frontend already renders nothing when the gradeitem is missing, so the lowest friction fix here is to just return an empty string as the name in cases where fetch() returns false.
Hit a cron error where a course has deleted a gradeitem, and not updated their cert. This is blocking the cron task from finishing fully.
I can see in other locations such as the date element fetching the gradeitem is done via element helper which returns a false, but in the gradeitemname element its direct fetched using the API, but not checked if its missing.
The frontend already renders nothing when the gradeitem is missing, so the lowest friction fix here is to just return an empty string as the name in cases where fetch() returns false.