From cb340f30f4c4017beb528c644374a7e372d382b9 Mon Sep 17 00:00:00 2001 From: Artem Andreev Date: Sat, 18 Sep 2010 12:49:38 +0400 Subject: [PATCH] Fixed bug with first access to attendance in each course --- locallib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/locallib.php b/locallib.php index bcd67bd..c80b85f 100644 --- a/locallib.php +++ b/locallib.php @@ -435,8 +435,10 @@ function print_filter_controls($url, $id, $sort=NULL, $printselector=WITHOUT_SEL $group = optional_param('group', -2, PARAM_INT); if ($group > -2) { $SESSION->attsessiontype[$cm->course] = $group; - } elseif (!array_key_exists('attsessiontype', $SESSION)) { - $SESSION->attsessiontype = array(); + } elseif (!array_key_exists($cm->course, $SESSION->attsessiontype)) { + if (!array_key_exists('attsessiontype', $SESSION)) { + $SESSION->attsessiontype = array(); + } $SESSION->attsessiontype[$cm->course] = -1; }