Lines 46-52
use Koha::Holds;
Link Here
|
46 |
use Koha::List::Patron; |
46 |
use Koha::List::Patron; |
47 |
use Koha::Patrons; |
47 |
use Koha::Patrons; |
48 |
use Koha::Patron::Categories; |
48 |
use Koha::Patron::Categories; |
49 |
use Koha::Schema; |
|
|
50 |
|
49 |
|
51 |
our (@ISA,@EXPORT,@EXPORT_OK,$debug); |
50 |
our (@ISA,@EXPORT,@EXPORT_OK,$debug); |
52 |
|
51 |
|
Lines 342-348
database column.
Link Here
|
342 |
=cut |
341 |
=cut |
343 |
|
342 |
|
344 |
sub get_cardnumber_length { |
343 |
sub get_cardnumber_length { |
345 |
my $borrower = Koha::Schema->resultset('Borrower'); |
344 |
my $borrower = Koha::Database->new->schema->resultset('Borrower'); |
346 |
my $field_size = $borrower->result_source->column_info('cardnumber')->{size}; |
345 |
my $field_size = $borrower->result_source->column_info('cardnumber')->{size}; |
347 |
my ( $min, $max ) = ( 0, $field_size ); # borrowers.cardnumber is a nullable varchar(20) |
346 |
my ( $min, $max ) = ( 0, $field_size ); # borrowers.cardnumber is a nullable varchar(20) |
348 |
$min = 1 if C4::Context->preference('BorrowerMandatoryField') =~ /cardnumber/; |
347 |
$min = 1 if C4::Context->preference('BorrowerMandatoryField') =~ /cardnumber/; |
349 |
- |
|
|