Bug 10476

Summary: Guarantor Search Not Limiting by Category Type
Product: Koha Reporter: David Cook <dcook>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P5 - low CC: gmcharlt, jonathan.druart, kyle.m.hall
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13021
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description David Cook 2013-06-17 03:59:40 UTC
Currently, the guarantor search is not being limited by category type.

In guarantor_search.pl, there is code that says the search of the borrowers table should be limited by the category_type "A" (i.e. Adult) (or "I" (i.e. Institution) in the event that the patron being guaranteed has a category_type of "P" (i.e. Professional). 

Here is the code:

my $search_category = 'A';
if ($category_type eq 'P'){
	$search_category = 'I';
}

$results = Search({''=>$member, category_type=>$search_category},$orderby);

However! If you investigate the "Search" sub and the subsequent "SearchInTable" sub, there is no reference to the "categories" table where the "category_type" column is located. Moreover, if you actually do a search for guarantors, you will always be able to retrieve any patron. 

That means that professionals can guarantee professionals, and children and guarantee children.

It looks like this bug was introduced when Search and SearchMember were unified into the one Search sub. 

--

Now...for our purposes at Prosentient...we actually want professionals to be able to guarantee professionals, so this bug is actually "beneficial".

However, I imagine lots of people in public libraries might not like having a guarantor search that doesn't weed out the children. 

I probably won't work on this bug (at least not any time soon), but it might an idea to create a system preference that allows users to decide what type of guarantor->guarantee relationship they want to set up in terms of category types.
Comment 1 Jonathan Druart 2015-04-21 12:59:59 UTC
This has been done on bug 13021.