Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-7634

Whitespace in filename prevents instantiation of enrolment plugin

    XMLWordPrintable

    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 (" ").

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: