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
---
 reports/borrowers_stats.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/reports/borrowers_stats.pl b/reports/borrowers_stats.pl
index b379067..a3d7bc7 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({}));
-- 
1.5.5.GIT

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to