Skip to content

Commit ac2fdda

Browse files
committed
Removed hack for Oracle databases as they are no longer supported (#701)
1 parent 1472921 commit ac2fdda

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

classes/task/issue_certificates_task.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,16 @@ public function get_name(): string {
4545
* Execute.
4646
*/
4747
public function execute() {
48-
global $CFG, $DB;
48+
global $DB;
4949

5050
// Get the certificatesperrun, includeinnotvisiblecourses, and certificateexecutionperiod configurations.
5151
$certificatesperrun = (int)get_config('customcert', 'certificatesperrun');
5252
$includeinnotvisiblecourses = (bool)get_config('customcert', 'includeinnotvisiblecourses');
5353
$certificateexecutionperiod = (int)get_config('customcert', 'certificateexecutionperiod');
5454
$offset = (int)get_config('customcert', 'certificate_offset');
55-
56-
if ($CFG->dbtype === 'oci') {
57-
// For Oracle, convert the CLOB to a VARCHAR2 (limiting to 4000 characters) since we are using DISTINCT.
58-
$emailothersselect = "DBMS_LOB.SUBSTR(c.emailothers, 4000, 1) AS emailothers";
59-
$emailotherslengthsql = "DBMS_LOB.GETLENGTH(c.emailothers)";
60-
} else {
61-
$emailothersselect = "c.emailothers";
62-
$emailotherslengthsql = $DB->sql_length('c.emailothers');
63-
}
64-
55+
$emailothersselect = "c.emailothers";
6556
$emailotherslengthsql = $DB->sql_length('c.emailothers');
57+
6658
$sql = "SELECT DISTINCT c.id, c.templateid, c.course, c.requiredtime, c.emailstudents, c.emailteachers, $emailothersselect,
6759
ct.id AS templateid, ct.name AS templatename, ct.contextid, co.id AS courseid,
6860
co.fullname AS coursefullname, co.shortname AS courseshortname

0 commit comments

Comments
 (0)