Bug 10476 - Guarantor Search Not Limiting by Category Type
Summary: Guarantor Search Not Limiting by Category Type
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-17 03:59 UTC by David Cook
Modified: 2015-12-03 22:00 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.