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

CustomFields for cohorts with default value lead to "Invalid Record" for enrollment

XMLWordPrintable

      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.

        1. screenshot-1.png
          screenshot-1.png
          65 kB
        2. screenshot-2.png
          screenshot-2.png
          48 kB
        3. screenshot-3.png
          screenshot-3.png
          117 kB

            pholden Paul Holden
            thomas.joscht Thomas Joscht
            Thomas Joscht Thomas Joscht
            Ilya Tregubov Ilya Tregubov
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 58 minutes
                58m

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