#187 Fix broken SQL on Oracle
This commit is contained in:
parent
71ea74a0ae
commit
7f592e332f
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;
|
global $DB, $PAGE;
|
||||||
|
|
||||||
// Get all the certificates that have requested someone get emailed.
|
// 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,
|
$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
|
co.fullname as coursefullname, co.shortname as courseshortname
|
||||||
FROM {customcert} c
|
FROM {customcert} c
|
||||||
|
@ -59,7 +60,7 @@ class email_certificate_task extends \core\task\scheduled_task {
|
||||||
ON c.course = co.id
|
ON c.course = co.id
|
||||||
WHERE (c.emailstudents = :emailstudents
|
WHERE (c.emailstudents = :emailstudents
|
||||||
OR c.emailteachers = :emailteachers
|
OR c.emailteachers = :emailteachers
|
||||||
OR c.emailothers != '')";
|
OR $emailotherslengthsql >= 3)";
|
||||||
if ($customcerts = $DB->get_records_sql($sql, array('emailstudents' => 1, 'emailteachers' => 1))) {
|
if ($customcerts = $DB->get_records_sql($sql, array('emailstudents' => 1, 'emailteachers' => 1))) {
|
||||||
// The renderers used for sending emails.
|
// The renderers used for sending emails.
|
||||||
$htmlrenderer = $PAGE->get_renderer('mod_customcert', 'email', 'htmlemail');
|
$htmlrenderer = $PAGE->get_renderer('mod_customcert', 'email', 'htmlemail');
|
||||||
|
|
Loading…
Reference in a new issue