MDL-85632 block_site_main_menu: Fix behat warning during init

This commit is contained in:
Sara Arjona
2025-05-30 16:17:43 +02:00
parent c39b737063
commit 4f73d6f57e
@@ -40,9 +40,15 @@ class block_site_main_menu extends block_base {
#[\Override]
function applicable_formats() {
$format = course_get_format($this->get_block_course());
$applicableformat = $format && !$format->has_view_page();
$course = $this->get_block_course();
if ($course->id == SITEID) {
return [
'site' => true,
];
}
$format = course_get_format($course);
$applicableformat = $format && !$format->has_view_page();
return [
'course-view' => $applicableformat,
'mod' => $applicableformat,