From d8a3b87c0e6f6ef643a5c536d5695ea60b1a33ae Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Sun, 1 May 2011 17:36:19 +0100 Subject: [PATCH] MDL-27340 tablelib.php fix a notice when is false. --- lib/tablelib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tablelib.php b/lib/tablelib.php index 07f5bf1f997..4039f9a4313 100644 --- a/lib/tablelib.php +++ b/lib/tablelib.php @@ -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);