From 0ba23332db19e287b83c897b95fcbd2dccb280ad Mon Sep 17 00:00:00 2001 From: Amaia Anabitarte Date: Fri, 22 Mar 2024 12:11:06 +0100 Subject: [PATCH] MDL-81335 core_course: Fix section page for 'manageactivities' only --- course/section.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/course/section.php b/course/section.php index 90de6483de3..fbcd0dd1394 100644 --- a/course/section.php +++ b/course/section.php @@ -146,8 +146,10 @@ if (!empty($bulkbutton)) { if ($format->show_editor()) { $sectionclass = new \core_courseformat\output\local\content\section($format, $sectioninfo); $renderable = $sectionclass->export_for_template($renderer); - $controlmenuhtml = $renderable->controlmenu->menu; - $PAGE->add_header_action($controlmenuhtml); + if (property_exists($renderable->controlmenu, 'menu')) { + $controlmenuhtml = $renderable->controlmenu->menu; + $PAGE->add_header_action($controlmenuhtml); + } $sectionheading = $OUTPUT->container( $OUTPUT->render($format->inplace_editable_render_section_name($sectioninfo, false)), attributes: ['data-for' => 'section_title'],