Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.7
-
Component/s: Database SQL/XMLDB, Enrolments
-
Labels:None
-
Database:Oracle
-
Affected Branches:MOODLE_17_STABLE
-
Fixed Branches:MOODLE_17_STABLE, MOODLE_18_STABLE
Description
From .../lib/xmldb/classes/generators/oci8po/oci9po.class.php:
// To define the default to set for NOT NULLs CHARs without default (null=do nothing)
// Using this whitespace here because Oracle doesn't distinguish empty and null! ![]()
This means courses get a default value for the (interactive) enrolment plugin that is a white space, and not and empty string, when we use the 'Site Default' option. Later, in .../enrol/enrol.class.php we do:
function factory($enrol = '') {
global $CFG;
if (!$enrol) {
$enrol = $CFG->enrol;
}
So we test whether $enrol is empty or not, to use the default interactive enrolment plugin. But this breaks with Oracle, as $enrol is not empty but has a single white space character. So we end up using an enrolment plugin called ' ', which doesn't exist and generates a run-time error when we do the require_once() a few lines below.
I'd have a cursory look, and I'd say there are other places where such assuption is made (emtpy field === default value), which totally breaks when using Oracle.
(I'd like to thank Mikel Kortabarria, our local Oracle guru, for tracking down this bug
.
Saludos. Iñaki.
Attachments
Issue Links
| This issue is duplicated by: | ||||
| MDL-7634 | Whitespace in filename prevents instantiation of enrolment plugin |
|
|
|
Uhm... in theory all the places using the get_recordXXXX() family of functions include one automatic transformation of whitespaces back to empty strings when information is retrieved to balance the default stored whitespaces.
Perhaps that value is not being retrieved using one of that functions but another one "harcoded" ExecuteQuery() or similar... do you know where exactly is that value retrieved from DB?
Anyway I'll take a look to it. Thanks.