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

Self enrolment simply tells "You can not enrol yourself in this course" instead of using the appropriate error strings

XMLWordPrintable

    • MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MDL-47761-master
    • Hide

      Note from the integrator:This has been backported to 27 and 28... specifically test there, plz:

      1. Create a course C
      2. Disable guest access, enable self enrolment
      3. Configure Self enrolment with "max enrolled users" = 1
      4. Login as student A
      5. Enrol into course C, enrolment should succeed
      6. Login as student B
      7. Enrol into course C, enrolment shouldn't be possible.
      8. Student B should be shown the error message "Maximum number of users allowed to access was already reached" (string 'maxenrolledreached | enrol_self')
      Show
      Note from the integrator:This has been backported to 27 and 28... specifically test there, plz: Create a course C Disable guest access, enable self enrolment Configure Self enrolment with "max enrolled users" = 1 Login as student A Enrol into course C, enrolment should succeed Login as student B Enrol into course C, enrolment shouldn't be possible. Student B should be shown the error message "Maximum number of users allowed to access was already reached" (string 'maxenrolledreached | enrol_self')

      Steps to reproduce:
      1. Create a course C
      2. Disable guest access, enable self enrolment
      3. Configure Self enrolment with "max enrolled users" = 1
      4. Login as student A
      5. Enrol into course C, enrolment should suceedd
      6. Login as student B
      7. Enrol into course C, enrolment shouldn't be possible.

      Actual result:
      Student B is shown the error message "You can not enrol yourself in this course" (string 'notenrollable | core_enrol')

      Expected result:
      Student B should be shown the error message "Maximum number of users allowed to access was already reached" (string 'maxenrolledreached | enrol_self')

      --------------------------------

      As this has already worked in previous Moodle versions, I think this is a regression.

      Hints for finding the bug:
      In /enrol/self/lib.php, can_self_enrol() returns the appropriate strings, but enrol_page_hook which calls can_self_enrol() doesn't process these strings and doesn't hand them over to /enrol/index.php. So /enrol/index.php simply displays the "notenrollable" string.

            moodle.com Moodle HQ
            abias Alexander Bias
            John Okely John Okely
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Zachary Durber Zachary Durber
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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