-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
4.2.3, 4.3
-
None
-
MOODLE_402_STABLE, MOODLE_403_STABLE
1. enrol student to course
2. create group(g1)
3. create group(g2) with "Group membership visibility" set to "hidden"
4. add user to group g1
5. create grouping(gr3) with group g1
6. add assignment to course with:
"Students submit in groups"-> "yes"
"Grouping for student groups" -> "gr3"
"Group mode" -> "Visible groups"
"Grouping" -> "gr3"
7. login with student account and try to access assignment
PHP error:
ERROR: Incorrect number of query parameters. Expected 25, got 20.
Debug info:
Error code: invalidqueryparam
line 957 of /lib/dml/moodle_database.php: dml_exception thrown
line 1393 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->fix_sql_params()
line 2298 of /mod/assign/locallib.php: call to mysqli_native_moodle_database->get_records_sql()
line 3055 of /mod/assign/locallib.php: call to assign->list_participants()
line 4914 of /mod/assign/locallib.php: call to assign->get_submission_group_members()
line 87 of /mod/assign/submission/comments/lib.php: call to assign->can_view_group_submission()
line 8213 of /lib/moodlelib.php: call to assignsubmission_comments_comment_permissions()
line 8171 of /lib/moodlelib.php: call to component_callback()
line 320 of /comment/lib.php: call to plugin_callback()
line 220 of /comment/lib.php: call to comment->check_permissions()
line 71 of /mod/assign/submission/comments/locallib.php: call to comment->__construct()
line 1048 of /mod/assign/classes/output/renderer.php: call to assign_submission_comments->view_summary()
line 495 of /lib/outputrenderers.php: call to mod_assign\output\renderer->render_assign_submission_plugin_submission()
line 857 of /mod/assign/classes/output/renderer.php: call to plugin_renderer_base->render()
line 495 of /lib/outputrenderers.php: call to mod_assign\output\renderer->render_assign_submission_status()
line 5523 of /mod/assign/locallib.php: call to plugin_renderer_base->render()
line 5894 of /mod/assign/locallib.php: call to assign->view_student_summary()
line 693 of /mod/assign/locallib.php: call to assign->view_submission_page()
line 55 of /mod/assign/view.php: call to assign->view()
mod/assign/locallib.php 2242 line
list($esql, $params) = get_enrolled_sql($this->context, 'mod/assign:submit', $currentgroup,
$this->show_only_active_users());
list($ssql, $sparams) = $this->get_submitted_sql($currentgroup);
$params += $sparams;
get_enrolled_sql(), get_submitted_sql() returns with same parameters names. Both using get_enrolled_with_capabilities_join().
Fix:
lib/grouplib.php in groups_get_members_join() after 1374 line add "$prefix"
diff --git a/lib/grouplib.php b/lib/grouplib.php
|
index b4f40e86a96..a933924d640 100644 |
--- a/lib/grouplib.php
|
+++ b/lib/grouplib.php
|
@@ -1371,7 +1371,8 @@ function groups_get_members_join($groupids, $useridcolumn, context $context = nu |
[$visibilitywhere, $visibilityparams] = \core_group\visibility::sql_member_visibility_where(
|
$prefix . 'g2', |
$prefix . 'gm2', |
- $ualias
|
+ $ualias,
|
+ $prefix
|
);
|
$where .= ' AND ' . $visibilitywhere; |
$param = array_merge($param, $visibilityparams);
|
- duplicates
-
MDL-79635 Incorrect number of query parameters while listing users by student
-
- Closed
-