Bugzilla – Attachment 47969 Details for
Bug 15479
SIPserver rejects renewals for patrons with alphanumeric cardnumbers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15479 Make ILS cardnumber comparison case insensitive
Bug-15479-Make-ILS-cardnumber-comparison-case-inse.patch (text/plain), 2.34 KB, created by
Kyle M Hall (khall)
on 2016-02-12 13:08:53 UTC
(
hide
)
Description:
Bug 15479 Make ILS cardnumber comparison case insensitive
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-02-12 13:08:53 UTC
Size:
2.34 KB
patch
obsolete
>From 4c5d80d8ca93aefbd94f6361c4017df24b1a3393 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Wed, 6 Jan 2016 12:56:24 +0000 >Subject: [PATCH] Bug 15479 Make ILS cardnumber comparison case insensitive > >The borrowers table is defined COLLATE=utf8_unicode_ci which means >that cardnumbers may be saved in either lowercase or uppercase and >these are considered equivalent. >The server was performing a case sensitive comparison between >the incoming patron identifier and that retrieved from the db >As a result some renewals were rejected as being on loan to >another borrower if the stored cardnumber differed in case. > >Make code comparison comply with db. > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/SIP/ILS.pm | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > >diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm >index 7d702b7..d6117c0 100644 >--- a/C4/SIP/ILS.pm >+++ b/C4/SIP/ILS.pm >@@ -146,8 +146,7 @@ sub checkout { > # holds checked inside do_checkout > # } elsif ($item->hold_queue && @{$item->hold_queue} && ! $item->barcode_is_borrowernumber($patron_id, $item->hold_queue->[0]->{borrowernumber})) { > # $circ->screen_msg("Item on Hold for Another User"); >- } elsif ($item->{patron} && ($item->{patron} ne $patron_id)) { >- # I can't deal with this right now >+ } elsif ($item->{patron} && !_ci_cardnumber_cmp($item->{patron},$patron_id)) { > $circ->screen_msg("Item checked out to another patron"); > } else { > $circ->do_checkout(); >@@ -155,7 +154,7 @@ sub checkout { > $debug and warn "circ is ok"; > # If the item is already associated with this patron, then > # we're renewing it. >- $circ->renew_ok($item->{patron} && ($item->{patron} eq $patron_id)); >+ $circ->renew_ok($item->{patron} && _ci_cardnumber_cmp($item->{patron}, $patron_id)); > > $item->{patron} = $patron_id; > $item->{due_date} = $circ->{due}; >@@ -174,6 +173,13 @@ sub checkout { > return $circ; > } > >+sub _ci_cardnumber_cmp { >+ my ( $s1, $s2) = @_; >+ # As the database is case insensitive we need to normalize two strings >+ # before comparing them >+ return ( uc($s1) eq uc($s2) ); >+} >+ > sub checkin { > my ( $self, $item_id, $trans_date, $return_date, $current_loc, $item_props, $cancel, $checked_in_ok ) = @_; > my ( $patron, $item, $circ ); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15479
:
46326
|
47105
|
47811
|
47812
| 47969 |
47970
|
47972