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

Restriction by group works incorrectly

XMLWordPrintable

    • MOODLE_402_STABLE, MOODLE_404_STABLE
    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • MDL-81850-403
    • MDL-81850-404
    • Hide
      1. Covered by automated tests (PHPUnit)

      Test affected plugin

      1. Install plugin:

        $ git clone https://github.com/mdjnelson/moodle-mod_customcert.git mod/customcert
        

      2. Log in as admin
      3. Create 3 users (user1..user3)
      4. Create a course
      5. Enrol 3 users in course as student
      6. Create two groups (group1..group2)
      7. Add user1 and user2 to group1
      8. Add user3 to group2
      9. Add a Custom certificate activity to the course
        • Email students: Yes
        • Restrict access > Add restriction
          • Group: group1
      10. Press Edit certificate
      11. Add a User field element
        • User field: Username
      12. Run cron
      13. Reload the Recipients page
      14. Confirm you see user1 & user2 listed
      Show
      Covered by automated tests (PHPUnit) Test affected plugin Install plugin: $ git clone https://github.com/mdjnelson/moodle-mod_customcert.git mod/customcert Log in as admin Create 3 users (user1..user3) Create a course Enrol 3 users in course as student Create two groups (group1..group2) Add user1 and user2 to group1 Add user3 to group2 Add a Custom certificate activity to the course Email students: Yes Restrict access > Add restriction Group: group1 Press Edit certificate Add a User field element User field: Username Run cron Reload the Recipients page Confirm you see user1 & user2 listed
    • 2

      availability_group/condition method is_available works incorrectly when $userid is different from global $USER->id

      After recent change (MDL-79174 , commit 238ea3d1a39e08970ebbf3e4825dfc7341f2c1c7), the method for retrieving user groups was altered. Currently, it fetches the groups for the global $USER instead of the user for which we intend to check.

      We encountered this behavior in the plugin:
      Bug report

      I checked with Moodle 4.4+ (Build: 20240503) but other versions are effected too.

            pholden Paul Holden
            Algirdas Algirdas Vainauskas
            Carlos Escobedo Carlos Escobedo
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            CiBoT CiBoT
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 58 minutes
                1h 58m

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