]> git.mjollnir.org Git - moodle.git/commitdiff
Removed some possible notices
authormoodler <moodler>
Sun, 24 Sep 2006 06:06:24 +0000 (06:06 +0000)
committermoodler <moodler>
Sun, 24 Sep 2006 06:06:24 +0000 (06:06 +0000)
course/lib.php

index 00644157b962a9052973cbf7ab5240436bb6c188..e542ec2f21adc6c80f5f66b70360087bb9a217bc 100644 (file)
@@ -1405,7 +1405,7 @@ function print_category_info($category, $depth, $files = false) {
     if ($files and $coursecount) {
         $courses = get_courses($category->id, 'c.sortorder ASC', 'c.id,c.sortorder,c.visible,c.fullname,c.shortname,c.password,c.summary,c.guest,c.cost,c.currency');
 
-        echo "<tr>";
+        echo '<tr>';
 
         if ($depth) {
             $indent = $depth*30;
@@ -1704,8 +1704,12 @@ function set_coursemodule_groupmode($id, $groupmode) {
 * the course module back to what it was originally.
 */
 function set_coursemodule_visible($id, $visible, $prevstateoverrides=false) {
-    $cm = get_record('course_modules', 'id', $id);
-    $modulename = get_field('modules', 'name', 'id', $cm->module);
+    if (!$cm = get_record('course_modules', 'id', $id)) {
+        return false;
+    }
+    if (!$modulename = get_field('modules', 'name', 'id', $cm->module)) {
+        return false;
+    }
     if ($events = get_records_select('event', "instance = '$cm->instance' AND modulename = '$modulename'")) {
         foreach($events as $event) {
             if ($visible) {