From 7f592e332f1430cd1293f14d2355e4e9832d95ca Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 12 Jul 2018 15:16:24 +0800 Subject: [PATCH] #187 Fix broken SQL on Oracle --- classes/task/email_certificate_task.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/task/email_certificate_task.php b/classes/task/email_certificate_task.php index 88fe7a6..3f13c01 100644 --- a/classes/task/email_certificate_task.php +++ b/classes/task/email_certificate_task.php @@ -50,6 +50,7 @@ class email_certificate_task extends \core\task\scheduled_task { global $DB, $PAGE; // Get all the certificates that have requested someone get emailed. + $emailotherslengthsql = $DB->sql_length('c.emailothers'); $sql = "SELECT c.*, ct.id as templateid, ct.name as templatename, ct.contextid, co.id as courseid, co.fullname as coursefullname, co.shortname as courseshortname FROM {customcert} c @@ -59,7 +60,7 @@ class email_certificate_task extends \core\task\scheduled_task { ON c.course = co.id WHERE (c.emailstudents = :emailstudents OR c.emailteachers = :emailteachers - OR c.emailothers != '')"; + OR $emailotherslengthsql >= 3)"; if ($customcerts = $DB->get_records_sql($sql, array('emailstudents' => 1, 'emailteachers' => 1))) { // The renderers used for sending emails. $htmlrenderer = $PAGE->get_renderer('mod_customcert', 'email', 'htmlemail');