From 73e6dae14ec5e637b14ab615ff96a6b9955c41d1 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 14 Nov 2023 15:51:42 +0100 Subject: [PATCH] course maxTime error --- core/module/course/course.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/module/course/course.php b/core/module/course/course.php index 75baa3f..28ff3b0 100644 --- a/core/module/course/course.php +++ b/core/module/course/course.php @@ -635,8 +635,7 @@ class course extends common && $this->courseIsAvailable($courseId) ) { // Récupérer la dernière page visitée par cet utilisateur si elle existe - if ($this->getData(['enrolment', $courseId, $userId, 'history'])) - $maxTime = max($this->getData(['enrolment', $courseId, $userId, 'history'])); + $maxTime = $this->getData(['enrolment', $courseId, $userId, 'history']) ? max($this->getData(['enrolment', $courseId, $userId, 'history'])) : null; if (is_int($maxTime)) { $redirect = helper::baseUrl() . array_search($maxTime, $this->getData(['enrolment', $courseId, $userId, 'history'])); } else {