MDL-44560 glossary: Fix pagination on glossary category view

Credit to Sebastian B for this fix
This commit is contained in:
John Okely
2015-01-16 11:12:42 +08:00
parent 2ea6a2b161
commit 3bb4665841
+7 -1
View File
@@ -267,7 +267,13 @@
}
break;
}
$count = $DB->count_records_sql("SELECT COUNT(DISTINCT(ge.id)) $sqlfrom $sqlwhere", $params);
$count = 0;
if ($tab == GLOSSARY_CATEGORY_VIEW && $hook == GLOSSARY_SHOW_ALL_CATEGORIES) {
$count = $DB->count_records_sql("SELECT COUNT(ge.id) $sqlfrom $sqlwhere", $params);
} else {
$count = $DB->count_records_sql("SELECT COUNT(DISTINCT(ge.id)) $sqlfrom $sqlwhere", $params);
}
$limitfrom = $offset;
$limitnum = 0;