Bugzilla – Attachment 107522 Details for
Bug 26035
AutoMemberNum fails on very large cardnumbers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26035: AutoMemberNum should support cardnumbers up to 32 characters
Bug-26035-AutoMemberNum-should-support-cardnumbers.patch (text/plain), 1.36 KB, created by
Andrew Fuerste-Henry
on 2020-07-29 19:16:23 UTC
(
hide
)
Description:
Bug 26035: AutoMemberNum should support cardnumbers up to 32 characters
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2020-07-29 19:16:23 UTC
Size:
1.36 KB
patch
obsolete
>From 2667b93f26726997b7f983b2ee100b8fad036c71 Mon Sep 17 00:00:00 2001 >From: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >Date: Wed, 29 Jul 2020 19:13:22 +0000 >Subject: [PATCH] Bug 26035: AutoMemberNum should support cardnumbers up to 32 > characters > >To test: >1- create a patron with cardnumber 12345678901234567890123456789012 (or any 32 character number) >2- turn on AutoMemberNum >3- create a new patron, save without a cardnumber >4- confirm that new patron has a cardnumber one more than the number from step 1 >--- > Koha/Patron.pm | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 5436ccc448..65692c7651 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -24,6 +24,7 @@ use Carp; > use List::MoreUtils qw( any uniq ); > use JSON qw( to_json ); > use Unicode::Normalize; >+use bigint; > > use C4::Context; > use C4::Log; >@@ -113,10 +114,10 @@ sub fixup_cardnumber { > my $max = Koha::Patrons->search({ > cardnumber => {-regexp => '^-?[0-9]+$'} > }, { >- select => \'CAST(cardnumber AS SIGNED)', >- as => ['cast_cardnumber'] >- })->_resultset->get_column('cast_cardnumber')->max; >- $self->cardnumber(($max || 0) +1); >+ order_by => \'(cardnumber+0) DESC', >+ })->next; >+ return unless $max; >+ $self->cardnumber(($max->cardnumber || 0) +1); > } > > =head3 trim_whitespace >-- >2.11.0
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 26035
:
107492
|
107522
|
107655