Skip to content

Commit

Permalink
Fixed SQL error in Oracle (#646)
Browse files Browse the repository at this point in the history
Also removed confusing comment.
  • Loading branch information
mdjnelson committed Oct 12, 2024
1 parent 35b62d0 commit dad3726
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions classes/task/issue_certificates_task.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)";
Expand Down

0 comments on commit dad3726

Please sign in to comment.