MDL-27340 tablelib.php fix a notice when is false.

This commit is contained in:
Tim Hunt 2011-05-01 17:36:19 +01:00
parent b8df9414bd
commit d8a3b87c0e

View File

@ -1348,9 +1348,9 @@ class table_sql extends flexible_table {
$this->countsql = 'SELECT COUNT(1) FROM '.$this->sql->from.' WHERE '.$this->sql->where;
$this->countparams = $this->sql->params;
}
$grandtotal = $DB->count_records_sql($this->countsql, $this->countparams);
if ($useinitialsbar && !$this->is_downloading()) {
$totalinitials = $DB->count_records_sql($this->countsql, $this->countparams);
$this->initialbars($totalinitials>$pagesize);
$this->initialbars($grandtotal > $pagesize);
}
list($wsql, $wparams) = $this->get_sql_where();
@ -1363,7 +1363,7 @@ class table_sql extends flexible_table {
$total = $DB->count_records_sql($this->countsql, $this->countparams);
} else {
$total = $totalinitials;
$total = $grandtotal;
}
$this->pagesize($pagesize, $total);