-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
3.2.3, 3.4.4, 3.5
-
MOODLE_32_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
-
wip-MDL-60160-master
-
Easy
-
Steps to replicate
- Create a Cohort
- Add a user to the Cohort (remember this user)
- Add more users to this cohort
- Create a Role which can be assigned at the user level
- Go to Site administration / ► Users / ► Permissions / ► Assign user roles to cohort
- Choose the user from step 2 you've added to the Cohort from the 'Select users to assign role' dropdown
- Select the Cohort you created from the 'Select cohorts' dropdown
- Click Assign
- Run the scheduled task -
php admin/tool/task/cli/schedule_task.php --execute=\\tool_cohortroles\\task\\cohort_role_sync --showdebugging
- Go to Site administration / ► Users / ► Accounts / ► Browse list of users
- Find the user from step 2 you added to the Cohort and delete the user
- 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.