MDL-87694 core: prevent empty heading in context header.

This commit is contained in:
Stefan Topfstedt
2026-02-02 11:34:20 -08:00
parent c6d921e53a
commit 6f84540075
+4 -1
View File
@@ -111,8 +111,11 @@ class context_header implements renderable, templatable {
*/
public function export_for_template(renderer_base $output): array {
// Heading.
$heading = '';
$headingtext = isset($this->heading) ? $this->heading : $output->get_page()->heading;
$heading = $output->heading($headingtext, $this->headinglevel, "h2 mb-0");
if ('' !== $headingtext) {
$heading = $output->heading($headingtext, $this->headinglevel, "h2 mb-0");
}
// Buttons.
if (isset($this->additionalbuttons)) {