From 7a98a786ab63090e9385ac7d7760438e55a0a37f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20Jacques?= Date: Tue, 7 Jun 2022 09:44:53 -0400 Subject: [PATCH] Fix checkbox section option on old courses --- src/lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.php b/src/lib.php index 2c10eb8..52cb9db 100644 --- a/src/lib.php +++ b/src/lib.php @@ -757,10 +757,10 @@ protected function update_format_options($data, $sectionid = null) { ), '', 'name,id,value'); $changed = $needrebuild = false; foreach ($defaultoptions as $key => $value) { + if (in_array($key, array('ttsectionshowactivities','ttsectiontitle')) && !$data[$key]){ + $data[$key] = 0; + } if (isset($records[$key])) { - if (in_array($key, array('ttsectionshowactivities','ttsectiontitle')) && !$data[$key]){ - $data[$key] = 0; - } if (array_key_exists($key, $data) && $records[$key]->value !== $data[$key]) { $value = $data[$key]; if (is_array($data[$key])) {