-
Bug
-
Resolution: Fixed
-
Minor
-
4.2.6, 4.3.2
-
MOODLE_402_STABLE, MOODLE_403_STABLE
-
MOODLE_402_STABLE, MOODLE_403_STABLE
-
MDL-80550-403 -
- Covered by automated tests (PHPUnit)
Hey,
we've encountered a bug with CustomFields for Cohorts. Setting a default value will lead to an error invalidrecord - Can't find data record in database table cohort. at course enrollment sync during selection of cohort in dropdown box.
Steps for Reproducing
- Fresh Moodle installation of newest version (tried with v4.3.2) with MariaDb database backend (used current bitnami docker image from 2024-01-08)
- Create Course
- Create Cohort
- Create Cohort custom field category with arbitrary name (like TestFields)
- Create Cohort custom field with arbitrary name (like TestField) of type "Short text" - IMPORTANT: During field creation set any Default Value.
- Try to create in course new enrolment method of "Cohort Sync".
- Try to select cohort in Search Dropdown => ABOVE ERROR IS SHOWN
Note
After removing of Default value (empty field) cohort selection starts to work normally again. Therefore error is linked to default value treatment for sure.
- is a regression caused by
-
MDL-77130 Add cohort custom fields functionality
-
- Closed
-