@@ -, +, @@ characters --- Koha/Patron.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/Koha/Patron.pm +++ a/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 --