From dad3726665560debef22e7ad0b0f14c8ccc9f721 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Sat, 12 Oct 2024 14:20:34 +0100 Subject: [PATCH] Fixed SQL error in Oracle (#646) Also removed confusing comment. --- classes/task/issue_certificates_task.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/task/issue_certificates_task.php b/classes/task/issue_certificates_task.php index 9c294fd2..89b09063 100644 --- a/classes/task/issue_certificates_task.php +++ b/classes/task/issue_certificates_task.php @@ -55,8 +55,9 @@ public function execute() { // We are going to issue 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 + $sql = "SELECT c.id, c.templateid, c.course, c.requiredtime, c.emailstudents, c.emailteachers, c.emailothers, + 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 JOIN {customcert_templates} ct ON c.templateid = ct.id @@ -67,7 +68,6 @@ public function execute() { LEFT JOIN {customcert_issues} ci ON c.id = ci.customcertid"; - // Add conditions to exclude certificates from hidden courses. $sql .= " WHERE (c.emailstudents = :emailstudents OR c.emailteachers = :emailteachers OR $emailotherslengthsql >= 3)";