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

Enrol plugins use student role but this may not exist

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.7.3, 3.8
    • Fix Version/s: None
    • Component/s: Enrolments
    • Labels:
      None
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE

      Description

      Enrolment plugins enrol_cohort, enrol_database, enrol_manual, enrol_mnet, enrol_paypal and enrol_self have a "Default role assignment" setting (e.g. enrol_self | roleid) with the default value "Student". The ID for this is read from mdl_role. However, the student role can be deleted (from Site administration → Users → Define roles) in which case PHP Notice-level messages are generated by the code, e.g. "PHP Notice: Trying to get property of non-object in …/enrol/cohort/settings.php on line 39".

      This appears to be the issue causing Trying to get property 'id' of non-object.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              leonstr Leon Stringer
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: