https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29268

--- Comment #7 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 211528
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211528&action=edit
Bug 29268: Correct cni handling for get_marc_host

get_marc_host searched the Control-number index for the complete $w, for
example "(OSt)123", which never matches a 001, then for the number alone.
It never used the control number identifier (003), so two hosts with the
same 001 and different 003 could not be told apart, and the $w of other
organizations were ignored. Only numeric control numbers were accepted.

Add get_host_queries, which builds the searches from every 773$w, most
specific first:
1. (OrgCode)number from our own MARCOrgCode: 001 and 003
2. (OrgCode)number of any other organization: 001 and 003
3. number without OrgCode: 001
4. the number of 1. and 2. alone, for hosts that have no 003

get_marc_host uses the first one that finds a single record, as before,
and still falls back to 773$0 and 773$9 when none does. The control
number may now contain letters, and repeated 773 and $w are all used.

To test:
1. prove t/db_dependent/Koha/Biblio/host_record.t
2. Set MARCOrgCode to OSt and add the hosts: 001 123 + 003 OSt,
   001 123 + 003 XYZ, and 001 ocm555 without 003
3. Add children with 773$w "(OSt)123", "(XYZ)123", "123" and
   "(OSt)ocm555"
4. In the staff client add the children to a basket and look at the
   host shown for each: "(OSt)123" finds the OSt host, "(XYZ)123" the
   XYZ host, "(OSt)ocm555" the host without 003, and "123" none as it
   is ambiguous

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to