turnitin / moodle-plagiarism_turnitin

Turnitin Plagiarism plugin for Moodle
http://www.turnitin.com
45 stars 69 forks source link

Error when students try to see rubric #558

Closed thepurpleblob closed 3 years ago

thepurpleblob commented 3 years ago

Following error is shown....

Exception - Argument 2 passed to has_capability() must be an instance of context, null given, called in [dirroot]/plagiarism/turnitin/ajax.php on line 162 More information about this error × Debug info: Error code: generalexceptionmessage × Stack trace:

Undefined variable: cm in /var/www/html/moodle/plagiarism/turnitin/ajax.php on line 160

Notice: Trying to get property of non-object in /var/www/html/moodle/plagiarism/turnitin/ajax.php on line 160 Notice: Undefined variable: cm in /var/www/html/moodle/plagiarism/turnitin/ajax.php on line 161 Notice: Trying to get property of non-object in /var/www/html/moodle/plagiarism/turnitin/ajax.php on line 161 Notice: Undefined variable: cm in /var/www/html/moodle/plagiarism/turnitin/ajax.php on line 162 Notice: Trying to get property of non-object in /var/www/html/moodle/plagiarism/turnitin/ajax.php on line 162 Notice: Undefined variable: context in /var/www/html/moodle/plagiarism/turnitin/ajax.php on line 162

ghost commented 3 years ago

We're getting the same error:

Exception - Argument 2 passed to has_capability() must be an instance of context, null given, called in [dirroot]/plagiarism/turnitin/ajax.php on line 163

This works on our live site, so appears to be a regression.


This is happening when a student tries to view the rub using the following link:

image

They are presented with:

image

The cause seems to be that the cmid query string parameter is empty when making the initial request to plagiarism/turnitin/ajax.php:

image

CharlotteSpinks commented 3 years ago

Hi @jbriggscmet we appear to have fixed this here https://github.com/turnitin/moodle-plagiarism_turnitin/pull/554, are you using the version that includes this fix?

ghost commented 3 years ago

Hi @CharlotteSpinks we've retested this issue in our test environment and it is now working as expected when using plugin version 2020113001. It looks like the Moodle CLI upgrade scripts did not clear the Moodle caches correctly, and an outdated version of the TurnItIn JavaScript files were being served to users.

CharlotteSpinks commented 3 years ago

@jbriggscmet That's great, thank you for letting us know 😄