Skip to content

Commit

Permalink
MDL-27340 tablelib.php fix a notice when is false.
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed May 1, 2011
1 parent b8df941 commit d8a3b87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/tablelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1348,9 +1348,9 @@ function query_db($pagesize, $useinitialsbar=true) {
$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();
Expand All @@ -1363,7 +1363,7 @@ function query_db($pagesize, $useinitialsbar=true) {

$total = $DB->count_records_sql($this->countsql, $this->countparams);
} else {
$total = $totalinitials;
$total = $grandtotal;
}

$this->pagesize($pagesize, $total);
Expand Down

0 comments on commit d8a3b87

Please sign in to comment.