From 851a693be444b6e9e038b80c0166a674f7fc2d1f Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 16 Oct 2008 10:24:32 -0500 Subject: [PATCH] bugfix: fixed reference to sort2 column in query Fixes following error when using the patron statistics report: DBD::mysql::st execute failed: Unknown column 'sort' in 'where clause' at /home/gmc/koha/dev/reports/borrowers_stats.pl line 127 Signed-off-by: Galen Charlton --- reports/borrowers_stats.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reports/borrowers_stats.pl b/reports/borrowers_stats.pl index 0245baadb1..1ef6823306 100755 --- a/reports/borrowers_stats.pl +++ b/reports/borrowers_stats.pl @@ -122,7 +122,7 @@ if ($do_it) { $req = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category='Bsort1' ORDER BY lib"); $req->execute; $template->param( SORT1_LOOP => $req->fetchall_arrayref({})); - $req = $dbh->prepare("SELECT DISTINCTROW sort2 AS value FROM borrowers WHERE sort2 IS NOT NULL AND sort <> '' ORDER BY sort2 LIMIT 200"); + $req = $dbh->prepare("SELECT DISTINCTROW sort2 AS value FROM borrowers WHERE sort2 IS NOT NULL AND sort2 <> '' ORDER BY sort2 LIMIT 200"); # More than 200 items in a dropdown is not going to be useful anyway, and w/ 50,000 patrons we can destory DB performance. $req->execute; $template->param( SORT2_LOOP => $req->fetchall_arrayref({})); -- 2.39.5