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

add_to_log failures when a course module idnumber is set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • 2.3.6
    • Module: Turnitintool
    • None
    • MOODLE_23_STABLE

      The add_to_log calls in update_instance and add_instance try to use the cmidnumber instead of the cmid.

      The cmid is the course module ID which is an integer and uniquely identifies the instance of the course module within Moodle. The Course Module idnumber is a string stored in the course_modules table to help identify the course module to an external system.

      As a result, the add_to_log calls fail because they attempt to set a stringy value to an integer field (cmid).

      Looking at update_instance, you overwriting the cmid with the instance id:

      function turnitintool_update_instance($turnitintool) {
       
          global $USER,$CFG;
       
          $turnitintool->timemodified = time();
          $turnitintool->id = $turnitintool->instance;
      

      The cmid is initially in the $turnitintool->id field, but is overwritten by the instance ID.

      To replicate:

      • Create a new TIT instance and specify an idnumber
      • Update that instance

      Both of these actions will cause the add_to_log call to fail, and an e-mail will be sent to the address set in $CFG->supportemail. If you have debugging enabled, you should also have a warning printed to screen.

            paul.dawson Paul Dawson (Inactive)
            dobedobedoh Andrew Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

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