From 71811083baa66a928638e33b19c528129f91ef26 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 30 Mar 2011 20:25:43 +0100 Subject: [PATCH] MDL-27035 table_sql forgets to set countparams. --- lib/tablelib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/tablelib.php b/lib/tablelib.php index e3d905dd4f1..efceb9c42f9 100644 --- a/lib/tablelib.php +++ b/lib/tablelib.php @@ -1346,6 +1346,7 @@ class table_sql extends flexible_table { if (!$this->is_downloading()) { if ($this->countsql === NULL) { $this->countsql = 'SELECT COUNT(1) FROM '.$this->sql->from.' WHERE '.$this->sql->where; + $this->countparams = $this->sql->params; } if ($useinitialsbar && !$this->is_downloading()) { $totalinitials = $DB->count_records_sql($this->countsql, $this->countparams);