From d066ed8db05b1070ba28c8a11ead43b3ce868d05 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Mon, 2 May 2016 15:34:15 +0800 Subject: [PATCH] MDL-53977 enrol_lti: a hack to workaround a hack to utilise DB caching --- enrol/lti/classes/helper.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/enrol/lti/classes/helper.php b/enrol/lti/classes/helper.php index f6a006ad098..d2d6336a575 100644 --- a/enrol/lti/classes/helper.php +++ b/enrol/lti/classes/helper.php @@ -267,7 +267,10 @@ class helper { $instance->enrol = 'lti'; $instance->status = $tool->status; $ltienrol = enrol_get_plugin('lti'); - $ltienrol->enrol_user($instance, $userid, null, time(), $timeend); + + // Hack - need to do this to workaround DB caching hack. See MDL-53977. + $timestart = intval(substr(time(), 0, 8) . '00') - 1; + $ltienrol->enrol_user($instance, $userid, null, $timestart, $timeend); } return self::ENROLMENT_SUCCESSFUL;