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

Add warning when self enrolment key is the same as the group key

XMLWordPrintable

    • MOODLE_38_STABLE, MOODLE_400_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-68712-401
    • Hide
      1. Log in as admin
      2. Create a user
      3. Create a course
      4. Add group to the course:
        • Group name: My group
        • Enrolment key: test
      5. Navigate to course enrolment methods
      6. Enable the Self enrolment (Student) method (which exists by default)
      7. Edit the Self enrolment (Student) method
        • Enrolment key: test
        • Use group enrolment keys: No
      8. Press Save changes
      9. Confirm the form saves without errors
      10. Edit the Self enrolment (Student) method (again)
        • Use group enrolment keys: Yes
      11. Press Save changes
      12. Confirm you see the form error: "Enrolment key matches an existing group enrolment key"
      13. Amend the form:
        • Enrolment key: test2
      14. Press Save changes
      15. Confirm the form saves without errors
      16. Navigate to course groups
      17. Edit the group you previously created:
        • Enrolment key: test2
      18. Log out
      19. Log in as test user
      20. Navigate to course
      21. Enter "test2" in the Enrolment key form
      22. Confirm you are enrolled on the course
      23. Log out
      24. Log in as admin
      25. Navigate to course groups
      26. Confirm test user is a member of My group
      Show
      Log in as admin Create a user Create a course Add group to the course: Group name: My group Enrolment key: test Navigate to course enrolment methods Enable the Self enrolment (Student) method (which exists by default) Edit the Self enrolment (Student) method Enrolment key: test Use group enrolment keys: No Press Save changes Confirm the form saves without errors Edit the Self enrolment (Student) method (again) Use group enrolment keys: Yes Press Save changes Confirm you see the form error: "Enrolment key matches an existing group enrolment key" Amend the form: Enrolment key: test2 Press Save changes Confirm the form saves without errors Navigate to course groups Edit the group you previously created: Enrolment key: test2 Log out Log in as test user Navigate to course Enter "test2" in the Enrolment key form Confirm you are enrolled on the course Log out Log in as admin Navigate to course groups Confirm test user is a member of My group

      As per the documentation here: https://docs.moodle.org/401/en/Enrolment_key, we should receive a warning when we choose the same enrolment key for the course as the group enrolment key.

      This is not the case and it results in the fact that  the student is not added to the this group after self enrolment into to the course.

      • Creating a course C1
      • Add a groupe G1 and set its enrolment key to "pass"
      • Adding Self enrolment as a method for C1
        • Set Enrolment key as 'pass'
        • Set Use group enrolment keys to "Yes"
        • Save settings
      • At this point we should have a a warning displaying that we have a similar key in one of the groups

       

      Notes from original ticket:

      The file "moodle/enrol/self/lib.php" contain at the line 162 an if statement:

      // code placeholder
      public function enrol_self(stdClass $instance, $data = null) {
      ......
              if ($instance->password and $instance->customint1 and $data->enrolpassword !== $instance->password) {
      ......
      

      Why $data->enrolpassword !== $instance->password ?

      It's obviously wrong.

      I'm missing something?

       

       

            pholden Paul Holden
            salex S. Alex
            David Woloszyn David Woloszyn
            Ilya Tregubov Ilya Tregubov
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 hour, 30 minutes Original Estimate - 1 hour, 30 minutes
                1h 30m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 46 minutes
                2h 46m

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