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

    Details

    • Testing Instructions:
      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')
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-47761-master

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  2/Feb/15