#187 Fix broken SQL on Oracle
This commit is contained in:
parent
54212da3d2
commit
91da92f10d
1 changed files with 2 additions and 1 deletions
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue