-
Bug
-
Resolution: Fixed
-
Minor
-
3.5
-
MOODLE_35_STABLE
-
MOODLE_33_STABLE, MOODLE_34_STABLE
-
MDL-61421-master -
Task cohort_role_sync attempts to sync users and fails when two cohorts have a common user.
Steps to replicate
- Create a Cohort 1
- Create a Cohort 2
- Add a user X to the Cohort 1
- Add the same user X to the Cohort 2
- Create a Role which can be assigned at the user level
- Go to Site administration / ► Users / ► Permissions / ► Assign user roles to cohort
- Choose a user Y from the 'Select users to assign role' dropdown
- Select the Cohort 1 and Cohort 2 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)
You will get the next message:
++ Did you remember to make the first column something unique in your call to get_records? Duplicate value '8' found in column 'userid'. ++