]> git.mjollnir.org Git - moodle.git/commitdiff
Modified the instance_is_visible function. It has a bug, having
authorstronk7 <stronk7>
Sat, 26 Apr 2003 09:34:11 +0000 (09:34 +0000)
committerstronk7 <stronk7>
Sat, 26 Apr 2003 09:34:11 +0000 (09:34 +0000)
the "forum" table harcoded. Simplify a bit. Now seems to work
fine with every mod.

lib/datalib.php

index a3a054cc1658ca04833c813bd9265db980759811..f4112e80a92bc604fff0b3f5c712cb49bd9ffa71 100644 (file)
@@ -1031,15 +1031,13 @@ function instance_is_visible($moduletype, $module) {
 
     global $CFG;
 
-    if ($records = get_records_sql("SELECT f.id, cm.visible
+    if ($records = get_records_sql("SELECT cm.instance, cm.visible
                                     FROM {$CFG->prefix}course_modules cm,
-                                         {$CFG->prefix}forum f,
                                          {$CFG->prefix}modules m
                                    WHERE cm.course = '$module->course' AND
                                          cm.module = m.id AND 
                                          m.name = '$moduletype' AND 
-                                         cm.instance = f.id AND 
-                                         f.id = '$module->id'")) {
+                                         cm.instance = '$module->id'")) { 
 
         foreach ($records as $record) { // there should only be one - use the first one
             return $record->visible;