MDL-60579 user: Check filter strings have correct part count

This commit is contained in:
Andrew Nicols
2017-11-09 09:07:02 +08:00
parent 3968d2ca7e
commit 446b21b512
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -277,6 +277,9 @@ class core_user_renderer extends plugin_renderer_base {
foreach ($filtersapplied as $filter) {
if (!array_key_exists($filter, $filteroptions)) {
$filtervalue = explode(':', $filter);
if (count($filtervalue) !== 2) {
continue;
}
$key = $filtervalue[0];
$value = $filtervalue[1];
@@ -108,6 +108,7 @@ Feature: Course participants can be filtered
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to course participants
# Note: This is the literal string "student", not the Role student.
When I set the field "Filters" to "student"
And I press key "13" in the field "Filters"
Then I should see "Student 1" in the "participants" "table"