]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed modid selection bug 1735
authormoodler <moodler>
Thu, 12 Aug 2004 09:55:12 +0000 (09:55 +0000)
committermoodler <moodler>
Thu, 12 Aug 2004 09:55:12 +0000 (09:55 +0000)
course/lib.php

index 9d08afd49546828e6f4564dba60441fec6f34e35..3c2c3a80314e17509ffb97185f428fdfccf06ca3 100644 (file)
@@ -450,10 +450,10 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per
         $joins[] = "l.module = '$modname'";
     }
 
-    if ($modid and is_int($modid)) {
-        $joins[] = "l.cmid = '$modid'";
-    } else if ('site_errors' === $modid) {
+    if ('site_errors' === $modid) {
         $joins[] = "l.action='error'";
+    } else if ($modid) {
+        $joins[] = "l.cmid = '$modid'";
     }
 
     if ($modaction) {
@@ -494,12 +494,14 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per
 
     $totalcount = 0;  // Initialise
 
+    $db->debug = true;
     if (!$logs = get_logs($selector, $order, $page*$perpage, $perpage, $totalcount)) {
         notify("No logs found!");
         print_footer($course);
         exit;
     }
 
+    $db->debug = false;
     $count=0;
     $ldcache = array();
     $tt = getdate(time());