mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-80121 grade: Trim heading
In order to prevent rendering an empty heading <h2>, we need to make sure that the $heading parameter passed to print_grade_page_head() is not an empty string.
This commit is contained in:
parent
8ad9114050
commit
d8dbfe5d25
@ -891,6 +891,12 @@ function print_grade_page_head(int $courseid, string $active_type, ?string $acti
|
||||
?string $headerhelpcomponent = null, ?stdClass $user = null, ?action_bar $actionbar = null, $showtitle = true) {
|
||||
global $CFG, $OUTPUT, $PAGE, $USER;
|
||||
|
||||
if ($heading !== false) {
|
||||
// Make sure to trim heading, including the non-breaking space character.
|
||||
$heading = str_replace(" ", " ", $heading);
|
||||
$heading = trim($heading);
|
||||
}
|
||||
|
||||
// Put a warning on all gradebook pages if the course has modules currently scheduled for background deletion.
|
||||
require_once($CFG->dirroot . '/course/lib.php');
|
||||
if (course_modules_pending_deletion($courseid, true)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user