-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
2.3.6
-
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.