]> git.mjollnir.org Git - moodle.git/commitdiff
merged fix for MDL-9160, get_my_courses caching issues
authortoyomoyo <toyomoyo>
Mon, 2 Apr 2007 03:53:10 +0000 (03:53 +0000)
committertoyomoyo <toyomoyo>
Mon, 2 Apr 2007 03:53:10 +0000 (03:53 +0000)
lib/datalib.php

index 80f09e81bb82b9b773b5c72fcf2836e11b3bc097..3941a65627063ac71f0001818472cf543c83d6f8 100644 (file)
@@ -685,8 +685,8 @@ function get_my_courses($userid, $sort='visible DESC,sortorder ASC', $fields='*'
     global $USER;
 
     if (!empty($USER->id) && ($USER->id == $userid)) {
-        if (!empty($USER->mycourses)) {
-            return $USER->mycourses;      // Just return the cached version
+        if (!empty($USER->mycourses[$doanything])) {
+            return $USER->mycourses[$doanything];      // Just return the cached version
         }
     }
 
@@ -771,7 +771,7 @@ ORDER BY $sort");
     }
 
     if (!empty($USER->id) && ($USER->id == $userid)) {
-        $USER->mycourses = $mycourses;
+        $USER->mycourses[$doanything] = $mycourses;
     }
 
     return $mycourses;