From a085adf2bc27a87809ce30870281d1b7c1a7edae Mon Sep 17 00:00:00 2001 From: Barry Oosthuizen Date: Tue, 31 Mar 2015 11:35:19 +0100 Subject: [PATCH] Check if there is a manual enrolment with no expiry date --- locallib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locallib.php b/locallib.php index c0bef5c..3e2e29c 100644 --- a/locallib.php +++ b/locallib.php @@ -1047,7 +1047,7 @@ class attendance { // CONTRIB-4868 $mintime = 'MIN(CASE WHEN (ue.timestart > :zerotime) THEN ue.timestart ELSE ue.timecreated END)'; - $maxtime = 'MAX(ue.timeend)'; + $maxtime = 'CASE WHEN MIN(ue.timeend) = 0 THEN 0 ELSE MAX(ue.timeend) END'; // CONTRIB-3549 $sql = "SELECT ue.userid, ue.status,