-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.4.4
Same issue as reported in MDL-75300
OBSERVED BEHAVIOR:
When accessing any H5P Module we get the following error:
Debug info: Unknown column 'reviewer.userid' in 'where clause'
|
SELECT COUNT(*)
|
FROM m_user u JOIN m_user_enrolments ej1_ue ON ej1_ue.userid = u.id
|
JOIN m_enrol ej1_e ON (ej1_e.id = ej1_ue.enrolid AND ej1_e.courseid = ?)
|
|
LEFT
|
JOIN m_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 => '2',
|
1 => '1',
|
2 => '1',
|
3 => 1,
|
)]
|
Error code: dmlreadexception Stack trace:
|
|
line 497 of /lib/dml/moodle_database.php: dml_read_exception thrown
|
line 346 of /lib/dml/moodle_read_replica_trait.php: call to moodle_database->query_end()
|
line 1364 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
|
line 1687 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
|
line 1760 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
|
line 1985 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
|
line 322 of /mod/h5pactivity/classes/local/manager.php: call to moodle_database->count_records_sql()
|
line 97 of /mod/h5pactivity/view.php: call to mod_h5pactivity\local\manager->count_attempts()
|
We did find that disabling the 'Enable attempt tracking' on the H5P settings allows the H5P content to load.
And same as the original bug reported what we could find out is that the core function the H5P activity used to generate the reveiwersjoin does not return a join via the 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.
EXPECTED BEHAVIOR:
H5P content loads with Enable attempt tracking enabled or disabled.
- has been marked as being related by
-
MDL-75300 Unknown column 'reviewer.userid' in 'where clause' in h5pactivity
-
- Closed
-