From 474991a19d040fc44a8415f5a33481d1cb4d513a Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Wed, 21 Feb 2007 13:09:17 +0000 Subject: [PATCH] D'oh - counting $totalcount wrongly (duplicate courses are ignored) --- course/search.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/course/search.php b/course/search.php index 1fbccb1439..d8b1667b43 100644 --- a/course/search.php +++ b/course/search.php @@ -125,7 +125,6 @@ // run through blocks and get (unique) courses $courses = array(); - $totalcount = 0; foreach ($blocks as $block) { $courseid = $block->pageid; if ($courseid==0) { @@ -135,8 +134,8 @@ error( "Could not read data for courseid=$courseid" ); } $courses[$courseid] = $course; - $totalcount++; } + $totalcount = count( $courses ); } // get list of courses containing modules if required elseif (!empty($modulelist) and confirm_sesskey()) { @@ -147,7 +146,6 @@ // run through modules and get (unique) courses $courses = array(); - $totalcount = 0; foreach ($modules as $module) { $courseid = $module->course; if ($courseid==0) { @@ -157,8 +155,8 @@ error( "Could not read data for courseid=$courseid" ); } $courses[$courseid] = $course; - $totalcount++; } + $totalcount = count($courses); } else { $courses = get_courses_search($searchterms, "fullname ASC", -- 2.39.5