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 595-601
database column.
Link Here
|
595 |
=cut |
594 |
=cut |
596 |
|
595 |
|
597 |
sub get_cardnumber_length { |
596 |
sub get_cardnumber_length { |
598 |
my $borrower = Koha::Schema->resultset('Borrower'); |
597 |
my $borrower = Koha::Database->new->schema->resultset('Borrower'); |
599 |
my $field_size = $borrower->result_source->column_info('cardnumber')->{size}; |
598 |
my $field_size = $borrower->result_source->column_info('cardnumber')->{size}; |
600 |
my ( $min, $max ) = ( 0, $field_size ); # borrowers.cardnumber is a nullable varchar(20) |
599 |
my ( $min, $max ) = ( 0, $field_size ); # borrowers.cardnumber is a nullable varchar(20) |
601 |
$min = 1 if C4::Context->preference('BorrowerMandatoryField') =~ /cardnumber/; |
600 |
$min = 1 if C4::Context->preference('BorrowerMandatoryField') =~ /cardnumber/; |
602 |
- |
|
|