I was getting an SQL error:
Debug info: Unknown column 'firstname' in 'where clause'
|
SELECT COUNT(DISTINCT(ra.userid))
|
FROM mdl_role_assignments ra
|
|
WHERE ra.contextid IN (661,2524,1) AND ra.roleid = ? AND firstname LIKE ? ESCAPE '\\'
|
[array (
|
0 => 16,
|
1 => 'A%',
|
)]
|
Stack trace:
|
line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown
|
line 794 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
|
line 1280 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
|
line 1355 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
|
line 1526 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
|
line 232 of /course/report/participation/index.php: call to moodle_database->count_records_sql()
|
by added the line "JOIN
{user} u ON u.id = ra.userid" just after line 225 that is : "FROM {role_assignments} ra"Issue was solved

see full code at line 224:
|
FROM {role_assignments} ra
JOIN {user}
u ON u.id = ra.userid
WHERE ra.contextid $relatedcontexts AND ra.roleid = :roleid";
|