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

Task cohort_role_sync attempts to sync deleted users

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.2.3, 3.4.4, 3.5
    • Fix Version/s: None
    • Component/s: Cohorts, Tasks

      Description

      Steps to replicate

      1. Create a Cohort
      2. Add a user to the Cohort (remember this user)
      3. Add more users to this cohort
      4. Create a Role which can be assigned at the user level
      5. Go to Site administration / ► Users / ► Permissions / ► Assign user roles to cohort
      6. Choose the user from step 2 you've added to the Cohort from the 'Select users to assign role' dropdown
      7. Select the Cohort you created from the 'Select cohorts' dropdown
      8. Click Assign
      9. Run the scheduled task -

        php admin/tool/task/cli/schedule_task.php --execute=\\tool_cohortroles\\task\\cohort_role_sync --showdebugging

      10. Go to Site administration / ► Users / ► Accounts / ► Browse list of users
      11. Find the user from step 2 you added to the Cohort and delete the user
      12. Run the scheduled task -

        php admin/tool/task/cli/schedule_task.php --execute=\\tool_cohortroles\\task\\cohort_role_sync --showdebugging

      You will get an error stating that the task failed due to the user ID not existing/being deleted.

      I could work around the issue by going into the database and editing the deleted flag in the database to 0, then run the scheduled task so it completes, then mark the user as deleted in the database again.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jamie.biddulph Jamie Biddulph
              Peer reviewer:
              Ilya Tregubov Ilya Tregubov
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona), Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              2 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

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