-
Bug
-
Resolution: Fixed
-
Minor
-
3.11.8, 4.0.5
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MOODLE_400_STABLE
-
On accessing a H5P Module we get the following error:
Debug-Info: Unknown column 'reviewer.userid' in 'where clause'
SELECT COUNT
FROM mdl_user u JOIN mdl_user_enrolments ej1_ue ON ej1_ue.userid = u.id
JOIN mdl_enrol ej1_e ON (ej1_e.id = ej1_ue.enrolid AND ej1_e.courseid = ?)
JOIN (SELECT DISTINCT userid
FROM mdl_role_assignments
WHERE contextid IN (1,839,891,894)
AND roleid IN (6,5,11,4,3,1)
) ra ON ra.userid = u.id
LEFT
JOIN mdl_h5pactivity_attempts ha ON ha.userid = u.id
WHERE 1 = 1 AND u.deleted = 0 AND u.id <> ? AND u.deleted = 0 AND reviewer.userid IS NULL AND ha.h5pactivityid = ? AND ha.completion = ?
[array (
0 => '14',
1 => '1',
2 => '12',
3 => 1,
)]
Error code: dmlreadexception
I can not give any repruduction instructions. It only appears on one system. So we only can guess it has something to do with that systems settings.
What i could find out is that the core function the H5P aktivity used to generate the reveiwersjoin didnt return a join(in function get_active_users_join):
// But excluding all reviewattempts users converting a capabilities join into left join.
$reviewersjoin = get_with_capability_join($context, 'mod/h5pactivity:reviewattempts', 'u.id');
That missing join leads to the error above. But we could not figure out why the join is missing.