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

Enrolment plugins break when no role has student archetype

XMLWordPrintable

    • MOODLE_310_STABLE, MOODLE_35_STABLE, MOODLE_39_STABLE
    • MOODLE_311_STABLE
    • MDL-63683-master
    • Hide

      Testing instructions

      1. Ensure debug mode is on
      2. Browse to: Site administration > Users > Permissions > Define roles
      3. Edit the student role (click the cog)
      4. Change the role archetype to "Teacher (editing)
      5. Go back to the main site administration page - Make sure no errors are shown

      Additionally, for each of the following plugin in: Site administration > Plugins > Enrolments > Manage enrol plugins:

      1. Cohort sync
      2. External database
      3. Enrolment on payment (note this is only available from 3.10 onwards)
      4. Manual enrolments
      5. MNet remote enrolments
      6. PayPal
      7. Self enrolment

      Visit their settings page and make sure no errors are shown

      Show
      Testing instructions Ensure debug mode is on Browse to: Site administration > Users > Permissions > Define roles Edit the student role (click the cog) Change the role archetype to "Teacher (editing) Go back to the main site administration page - Make sure no errors are shown Additionally, for each of the following plugin in: Site administration > Plugins > Enrolments > Manage enrol plugins: Cohort sync External database Enrolment on payment (note this is only available from 3.10 onwards) Manual enrolments MNet remote enrolments PayPal Self enrolment Visit their settings page and make sure no errors are shown

      Reproduction steps

      1. Ensure debug mode is on
      2. Browse to: Site administration > Users > Permissions > Define roles
      3. Edit the student role (click the cog)
      4. Change the role archetype to "Teacher (editing)
      5. Go back to the main site administration page - you should see a bunch of errors

      The issues seems to be that many enrolment plugins have this in their settings.php:

             $student = get_archetype_roles('student'); 
             $student = reset($student); 
             $settings->add(new admin_setting_configselect_with_advanced('enrol_mnet/roleid',            get_string('defaultrole', 'role'), '',            array('value'=>$student->id, 'adv'=>true), $options));
      

      When no role has the student archetype, then $student is not an object and $student->id fails.

        1. MDL-63683.jpg
          22 kB
          Anna Carissa Sadia
        2. MDL-63683 (2).jpg
          76 kB
          Anna Carissa Sadia

            davidcarrillo David Carrillo
            cameron1729 cameron1729
            Paul Holden Paul Holden
            Victor Déniz Falcón Victor Déniz Falcón
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 20 minutes
                3h 20m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.