compilatio / moodle-plagiarism_compilatio

Compilatio.net plagiarism plugin for Moodle
4 stars 9 forks source link

cron PHP debugging notices displayed using version 2.6.0 #61

Closed lwafflard closed 1 year ago

lwafflard commented 2 years ago

Using version 2.60 on moodle 3.10.6

$plugin->version    = 2021062300

PHP Notice:  Trying to get property 'code' of non-object in plagiarism/compilatio/lib.php on line 1914
PHP Notice:  Trying to get property 'code' of non-object in plagiarism/compilatio/lib.php on line 1918
PHP Notice:  Trying to get property 'string' of non-object in plagiarism/compilatio/lib.php on line 1925

It seems function start_analyse can return a bool, an object or a string. This last case is not tested in function compilatio_startanalyse :

if ($analyse === true) {
...} else {
        if ($analyse->code == 'INVALID_ID_DOCUMENT') {  // lib.php line 1914
compilatio commented 1 year ago

Hello, this issue has been fixed in the last version of the plugin : 2.6.8.