From c73b2f8bba380de851d22f5d5d3e90d6208755a3 Mon Sep 17 00:00:00 2001
From: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Date: Thu, 7 Aug 2014 10:29:37 +0200
Subject: [PATCH] Bug 12727 - Patron category filter in batch patron deletion
 tool is broken

After commit 6973e3b7d50777a147a29f2f3d213a6175c9eb74, patron category
filter in batch patron deletion tool (tools/cleanborrowers.pl) doesn't
work properly any longer. It's still possible to choose a patron
category as selection criterion, but this criterion is being
efectivelly ignored on futhers steps.

As a result, all patrons (with no check-outs and no outstanding
account balance) may get mistakenly deleted when using this tool,
despite their respective categories.

To test:

1/ apply patch
2/ follow the test plan[s] for Bug 11975

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
---
 tools/cleanborrowers.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/cleanborrowers.pl b/tools/cleanborrowers.pl
index 3563c9d..9a9c1ca 100755
--- a/tools/cleanborrowers.pl
+++ b/tools/cleanborrowers.pl
@@ -183,7 +183,7 @@ sub _get_selection_params {
         dateformat => 'iso',
         dateonly   => 1
     }) if $borrower_dateexpiry;
-    $params->{borrower_categorycode} = $borrower_categorycode if $borrower_categorycode;
+    $params->{category_code} = $borrower_categorycode if $borrower_categorycode;
 
     return $params;
 };
-- 
2.0.1