Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-3889

Module Checklist: Call to database function passes invalid array

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.1.7, 2.2.4, 2.3.1
    • None
    • Package: Checklist
    • None
    • MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE

    Description

      The problem came about using the LMB Enrolment plug-in. When checklist is updating the grades, it can generate the following error:

      Coding error detected, it must be fixed by a programmer: moodle_database::get_in_or_equal() does not accept empty arrays
       
      More information about this error
      Stack trace:
       
          line 595 of /lib/dml/moodle_database.php: coding_exception thrown
          line 296 of /mod/checklist/lib.php: call to moodle_database->get_in_or_equal()
          line 1186 of /lib/gradelib.php: call to checklist_update_grades()
          line 1154 of /lib/gradelib.php: call to grade_update_mod_grades()
          line 989 of /lib/gradelib.php: call to grade_grab_course_grades()
          line 2809 of /enrol/lmb/lib.php: call to grade_recover_history_grades()
          line 2714 of /enrol/lmb/lib.php: call to enrol_lmb_plugin->lmb_assign_role_log()
          line 2309 of /enrol/lmb/lib.php: call to enrol_lmb_plugin->process_enrolment_log()
          line 2181 of /enrol/lmb/lib.php: call to enrol_lmb_plugin->process_person_membership_tag()
          line 2162 of /enrol/lmb/lib.php: call to enrol_lmb_plugin->process_membership_tag_error()
          line 288 of /enrol/lmb/lib.php: call to enrol_lmb_plugin->process_membership_tag()
          line 391 of /enrol/lmb/lib.php: call to enrol_lmb_plugin->process_file()
          line 44 of /enrol/lmb/tools/extractprocess.php: call to enrol_lmb_plugin->process_folder()

      It looks like the line:

      list($isql, $iparams) = $DB->get_in_or_equal(array_keys($items));

      needs to check if $items is not empty.

      Attachments

        Activity

          People

            davosmith Davo Smith
            mchurch Mike Churchward
            Davo Smith
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: