diff --git a/course/format/classes/base.php b/course/format/classes/base.php index 69eba0a0042..799bb09f1e4 100644 --- a/course/format/classes/base.php +++ b/course/format/classes/base.php @@ -966,11 +966,11 @@ abstract class base { } } - if ($targetsectionid) { - $params['sectionid'] = $targetsectionid; + if (isset($targetsectionid)) { + $params['targetsectionid'] = $targetsectionid; } - if ($targetcmid) { - $params['cmid'] = $targetcmid; + if (isset($targetcmid)) { + $params['targetcmid'] = $targetcmid; } if ($returnurl) { $params['returnurl'] = $returnurl->out_as_local_url();