From e953e71c54b52ce11f700034c4ed9f2737a0668c Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Thu, 22 Jun 2023 14:02:22 +0800 Subject: [PATCH 1/4] MDL-78550 grade: Fix HTML validator errors * Remove invalid "text" attribute in elements * Use proper id value for grade category checkboxes. --- grade/edit/tree/lib.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/grade/edit/tree/lib.php b/grade/edit/tree/lib.php index d49b451fe52..1e27fa5dff9 100644 --- a/grade/edit/tree/lib.php +++ b/grade/edit/tree/lib.php @@ -749,13 +749,11 @@ abstract class grade_edit_tree_column { public function get_category_cell($category, $levelclass, $params) { $cell = clone($this->categorycell); $cell->attributes['class'] .= ' ' . $levelclass; - $cell->attributes['text'] = ''; return $cell; } public function get_item_cell($item, $params) { $cell = clone($this->itemcell); - $cell->attributes['text'] = ''; if (isset($params['level'])) { $level = $params['level'] + (($item->itemtype == 'category' || $item->itemtype == 'course') ? 0 : 1); $cell->attributes['class'] .= ' level' . $level; @@ -1029,7 +1027,7 @@ class grade_edit_tree_column_select extends grade_edit_tree_column { } // Build the master checkbox. $mastercheckbox = new \core\output\checkbox_toggleall($togglegroup, true, [ - 'id' => $togglegroup, + 'id' => 'select_category_' . $category->id, 'name' => $togglegroup, 'value' => 1, 'classes' => 'itemselect ignoredirty', From b98fb9032c3d015a5a469f6a4533d5c9ec856c91 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Thu, 22 Jun 2023 14:19:51 +0800 Subject: [PATCH 2/4] MDL-78550 grade: Avoid rendering an empty

heading --- grade/lib.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/grade/lib.php b/grade/lib.php index f069d54da72..94e5d799397 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -970,15 +970,13 @@ function print_grade_page_head(int $courseid, string $active_type, ?string $acti $output = ''; // Add a help dialogue box if provided. - if (isset($headerhelpidentifier)) { + if (isset($headerhelpidentifier) && !empty($heading)) { $output = $OUTPUT->heading_with_help($heading, $headerhelpidentifier, $headerhelpcomponent); - } else { - if (isset($user)) { - $renderer = $PAGE->get_renderer('core_grades'); - $output = $OUTPUT->heading($renderer->user_heading($user, $courseid)); - } else { - $output = $OUTPUT->heading($heading); - } + } else if (isset($user)) { + $renderer = $PAGE->get_renderer('core_grades'); + $output = $OUTPUT->heading($renderer->user_heading($user, $courseid)); + } else if (!empty($heading)) { + $output = $OUTPUT->heading($heading); } if ($return) { From 27f453d6e92bc4ae2b4c3124805e001bfa757b1e Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Thu, 13 Jul 2023 12:34:15 +0800 Subject: [PATCH 3/4] MDL-78550 grade: Hide empty fillers from the accessibility tree * And remove the title attribute for the filler as it is unnecessary. --- grade/edit/tree/lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grade/edit/tree/lib.php b/grade/edit/tree/lib.php index 1e27fa5dff9..9a82049c0a7 100644 --- a/grade/edit/tree/lib.php +++ b/grade/edit/tree/lib.php @@ -312,8 +312,8 @@ class grade_edit_tree { $headercell = new html_table_cell(); $headercell->header = true; $headercell->scope = 'row'; - $headercell->attributes['title'] = $object->stripped_name; $headercell->attributes['class'] = 'cell column-rowspan rowspan ' . $levelclass; + $headercell->attributes['aria-hidden'] = 'true'; $headercell->rowspan = $row_count + 1; $row->cells[] = $headercell; @@ -338,6 +338,7 @@ class grade_edit_tree { $endcell = new html_table_cell(); $endcell->colspan = (19 - $level); $endcell->attributes['class'] = 'emptyrow colspan ' . $levelclass; + $endcell->attributes['aria-hidden'] = 'true'; $returnrows[] = new html_table_row(array($endcell)); From ebe27cf615337dd88cbb13cd3ec617273d7b7378 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Fri, 28 Jul 2023 17:32:10 +0800 Subject: [PATCH 4/4] MDL-78550 core: Ensure spacing between more menu item attributes --- lib/templates/moremenu_children.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/templates/moremenu_children.mustache b/lib/templates/moremenu_children.mustache index bed6e9d8cd9..cc7d5b56673 100644 --- a/lib/templates/moremenu_children.mustache +++ b/lib/templates/moremenu_children.mustache @@ -43,7 +43,7 @@ {{#children}} {{^divider}} {{#is_action_link}} - {{{text}}} @@ -86,7 +86,7 @@ {{/istablist}} {{^istablist}} {{#is_action_link}} - + {{{text}}} {{#action_link_actions}}