turnitin / moodle-mod_turnitintooltwo

Turnitin Direct plugin (version 2) for Moodle
http://www.turnitin.com
32 stars 63 forks source link

User type exception trying to get fullname for revealed anonymous student. #705

Open matithyah opened 6 months ago

matithyah commented 6 months ago

I believe the below exception happens when a Teacher / Instructor tries to reveal the name of an Anonymous student from the Turnitin inbox assignment list. When making the AJAX call to get the name to show, Moodle doesn't accept the variable type that Turnitintooltwo makes when creating the $user variable that it passes to Moodle's fullname() function.

Default exception handler: Exception - core_user::get_fullname(): Argument #1 ($user) must be of type stdClass, turnitintooltwo_user given, called in [dirroot]/lib/moodlelib.php on line 3653 Debug: \nError code: generalexceptionmessage\n line 1293 of /lib/classes/user.php: TypeError thrown\n line 3653 of /lib/moodlelib.php: call to core_user::get_fullname()\n* line 580 of /mod/turnitintooltwo/ajax.php: call to fullname()\n, referer: https://...../mod/turnitintooltwo/view.php?id=NNNNN Have obscured the Site URL and entry ID number.

Moodle is 4.3.1 (latest), running on PHP 8.1.20, Apache 2.4, Linux