From e35885aa73c545a948c547df33cce031d597b96a Mon Sep 17 00:00:00 2001 From: Nicolas Dunand Date: Tue, 15 Nov 2022 15:13:16 +0100 Subject: [PATCH] Fix for #179 --- view.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/view.php b/view.php index 3b01acc..30a269c 100644 --- a/view.php +++ b/view.php @@ -183,13 +183,15 @@ } } -if (class_exists('\core_completion\cm_completion_details') && class_exists('\core\activity_dates')) { - // Show the activity dates and completion details. - $modinfo = get_fast_modinfo($course); - $cminfo = $modinfo->get_cm($cm->id); - $cmcompletion = \core_completion\cm_completion_details::get_instance($cminfo, $USER->id); - $activitydates = \core\activity_dates::get_dates_for_module($cminfo, $USER->id); - echo $OUTPUT->activity_information($cminfo, $cmcompletion, $activitydates); +if ($CFG->branch < 400) { + if (class_exists('\core_completion\cm_completion_details') && class_exists('\core\activity_dates')) { + // Show the activity dates and completion details. + $modinfo = get_fast_modinfo($course); + $cminfo = $modinfo->get_cm($cm->id); + $cmcompletion = \core_completion\cm_completion_details::get_instance($cminfo, $USER->id); + $activitydates = \core\activity_dates::get_dates_for_module($cminfo, $USER->id); + echo $OUTPUT->activity_information($cminfo, $cmcompletion, $activitydates); + } } /// Check to see if groups are being used in this choicegroup