Moodle

Whitespace in filename prevents instantiation of enrolment plugin

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor 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

Activity

Hide
Petr Škoda (skodak) added a comment -

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...

Show
Petr Škoda (skodak) added a comment - 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...
Hide
Eloy Lafuente (stronk7) added a comment -

Thanks!

In theory we are converting back all those " " (spaces) to "" (empty string) in all the dmlib getXXX functions(). Obviously we have forgotten to do the conversion somewhere (as defined by this bug). I'll take a look to it in some hours (trying to find the origin and to fix it there).

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Thanks! In theory we are converting back all those " " (spaces) to "" (empty string) in all the dmlib getXXX functions(). Obviously we have forgotten to do the conversion somewhere (as defined by this bug). I'll take a look to it in some hours (trying to find the origin and to fix it there). Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Mark,

we have detected the cause of this problem (use of recordsets under Oracle) and it's being discussed in MDL-7634.

So I close this as duplicate. Thanks! B-)

Show
Eloy Lafuente (stronk7) added a comment - Hi Mark, we have detected the cause of this problem (use of recordsets under Oracle) and it's being discussed in MDL-7634. So I close this as duplicate. Thanks! B-)
Hide
Eloy Lafuente (stronk7) added a comment -

Argh. Sorry the correct bug is MDL-8134. (copy/paste is far from my skills)

Show
Eloy Lafuente (stronk7) added a comment - Argh. Sorry the correct bug is MDL-8134. (copy/paste is far from my skills)

People

Dates

  • Created:
    Updated:
    Resolved: