From 64f0c4ceaa4ae2826a906b836fc573f74ffbea8c Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Fri, 16 Aug 2019 18:10:39 +0800 Subject: [PATCH] MDL-66187 format_singleactivity: Make sure available types is not empty --- course/format/singleactivity/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/course/format/singleactivity/lib.php b/course/format/singleactivity/lib.php index 6556c127e50..5db9dea89ea 100644 --- a/course/format/singleactivity/lib.php +++ b/course/format/singleactivity/lib.php @@ -181,7 +181,7 @@ class format_singleactivity extends format_base { ), ); - if (!isset($availabletypes[$config->activitytype])) { + if (!empty($availabletypes) && !isset($availabletypes[$config->activitytype])) { $courseformatoptions['activitytype']['default'] = array_keys($availabletypes)[0]; } }