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

Error when cancelling add cohort_sync enrolment method

XMLWordPrintable

    • PostgreSQL
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • Hide

      Note: requires Postgres as database in order to reproduce (use Docker)

      1. Login as admin
      2. Create a cohort in the system context
      3. Create new course
      4. Click Participants
      5. Click Actions menu > Enrolment methods
      6. Choose Add method > Cohort sync
      7. Press Cancel
      8. Confirm you are returned to the enrolment methods page, no exception is thrown
      9. Choose Add method > Cohort sync (again)
      10. Select cohort from step 2. and press Add method
      11. Confirm new Cohort sync (<NAME> - Student) enrolment method is created
      12. Edit the enrolment method you just created
      13. Confirm the form loads with previously selected cohort selected/frozen
      Show
      Note: requires Postgres as database in order to reproduce (use Docker) Login as admin Create a cohort in the system context Create new course Click Participants Click Actions menu > Enrolment methods Choose Add method > Cohort sync Press Cancel Confirm you are returned to the enrolment methods page, no exception is thrown Choose Add method > Cohort sync (again) Select cohort from step 2. and press Add method Confirm new Cohort sync (<NAME> - Student) enrolment method is created Edit the enrolment method you just created Confirm the form loads with previously selected cohort selected/frozen

      Error occurs when you start adding the cohort_sync enrol metod, and click the Cancel button without filing up the form.

      Our environment:

      Nginx, PHP 7.3, Postgres 11.

      To reproduce.

      1. Create at least one system cohort.
      2. Create course
      3. Enter the Course
      4. Click participants
      5. Under the cog click Enrolment methods
      6. Choose Cohort sync in Add method dropdown
      7. Click Cancel 

      After that you got the error:

       
      Error reading from database

      More information about this error
      ×Debug info: BŁĄD: invalid input syntax for integer: ""
      SELECT * FROM mdl_cohort WHERE id = $1 ORDER BY name
      – line 1500 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
      – line 603 of /lib/pear/HTML/QuickForm/select.php: call to MoodleQuickForm_cohort->setValue()
      – line 230 of /lib/form/autocomplete.php: call to HTML_QuickForm_select->onQuickFormEvent()
      – line 2071 of /lib/formslib.php: call to MoodleQuickForm_autocomplete->onQuickFormEvent()
      – line 324 of /lib/formslib.php: call to MoodleQuickForm->updateSubmission()
      – line 228 of /lib/formslib.php: call to moodleform->_process_submission()
      – line 69 of /enrol/editinstance.php: call to moodleform->__construct()
      [array (
      0 => '',
      )]
      Error code: dmlreadexception
      ×Stack trace: * line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown

      • line 329 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      • line 920 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      • line 1500 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
      • line 136 of /lib/form/cohort.php: call to moodle_database->get_records_select()
      • line 603 of /lib/pear/HTML/QuickForm/select.php: call to MoodleQuickForm_cohort->setValue()
      • line 230 of /lib/form/autocomplete.php: call to HTML_QuickForm_select->onQuickFormEvent()
      • line 2071 of /lib/formslib.php: call to MoodleQuickForm_autocomplete->onQuickFormEvent()
      • line 324 of /lib/formslib.php: call to MoodleQuickForm->updateSubmission()
      • line 228 of /lib/formslib.php: call to moodleform->_process_submission()
      • line 69 of /enrol/editinstance.php: call to moodleform->__construct()
         

        1. MDL-71306_master_Step 11.png
          MDL-71306_master_Step 11.png
          77 kB
        2. MDL-71306_master_Step 13.png
          MDL-71306_master_Step 13.png
          73 kB
        3. MDL-71306_master_Step 8.png
          MDL-71306_master_Step 8.png
          71 kB
        4. MDL-71306_v3.10_Step 11.png
          MDL-71306_v3.10_Step 11.png
          67 kB
        5. MDL-71306_v3.10_Step 13.png
          MDL-71306_v3.10_Step 13.png
          66 kB
        6. MDL-71306_v3.10_Step 8.png
          MDL-71306_v3.10_Step 8.png
          62 kB
        7. MDL-71306_v3.11_Step 11.png
          MDL-71306_v3.11_Step 11.png
          67 kB
        8. MDL-71306_v3.11_Step 13.png
          MDL-71306_v3.11_Step 13.png
          65 kB
        9. MDL-71306_v3.11_Step 8.png
          MDL-71306_v3.11_Step 8.png
          60 kB

            pholden Paul Holden
            adamtppaw Adam Pawełczak
            David Carrillo David Carrillo
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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