Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 1.7
-
Fix Version/s: None
-
Component/s: Enrolments
-
Labels:None
-
Environment:Windows Server 2003, IIS6, php 5.2.0, oracle XE database.
-
Database:Oracle
-
Affected Branches:MOODLE_17_STABLE
Description
If a user clicks a login link from the front page of the site (as opposed to clicking on a course), and then logs in as a student, an error message is displayed, in the middle of the course listing.
"Fatal Error: Call to a member function get_access_icons() on a non-object in C:\moodle\course\lib.php on line 1575".
Upon further investigate the failure is in course/lib.php:1575
echo $enrol->get_access_icons($course);
$enrol appears to be a non-object because of a failure in the call on line 1574:
$enrol = enrolment_factory::factory($course->enrol);
In this case $course->enrol appears to equal a single space(" "). I have worked around it by changing enrol/enrol.class.php:10 to
if ((!$enrol) | (trim($enrol) == "")) {
But I believe the issue exists within course/lib.php, as $course->enrol should not be a single space (" ").
Issue Links
| This issue duplicates: | ||||
| MDL-8134 | Default value for empty fields in Oracle breaks default interactive enrolment (and maybe other places) |
|
|
|
Assigning to Eloy our Oracle guru, the problem is most probably cause by the null workaround used for oracle databases - empty string is used to indicate site default enrolment plugin, which is converted to space...