From 99caf5329ba2fecd7296c0d85baf49ffb8d6cd81 Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Mon, 19 Jun 2017 15:04:28 +0000 Subject: [PATCH] Bug 13178: increase max value of CardnumberLength MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit testplan 1 - Apply patch 2 - Run updatedatabase.pl 3 - Update dbix scheme 4 - set the value of CardnumberLength to a value between 16 and 32 5 - Check you can enter a propper cardnumber (modify to 32 instead 20) + max value now depends on the database field value to Signed-off-by: Marc Véron Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- C4/Members.pm | 2 +- .../data/mysql/atomicupdate/bug_13178_wide_cardnumber.sql | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_13178_wide_cardnumber.sql diff --git a/C4/Members.pm b/C4/Members.pm index f31ef8d40c..07cb08a602 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -896,7 +896,7 @@ database column. =cut sub get_cardnumber_length { - my ( $min, $max ) = ( 0, 16 ); # borrowers.cardnumber is a nullable varchar(16) + my ( $min, $max ) = ( 0, 32 ); # borrowers.cardnumber is a nullable varchar(20) $min = 1 if C4::Context->preference('BorrowerMandatoryField') =~ /cardnumber/; if ( my $cardnumber_length = C4::Context->preference('CardnumberLength') ) { # Is integer and length match diff --git a/installer/data/mysql/atomicupdate/bug_13178_wide_cardnumber.sql b/installer/data/mysql/atomicupdate/bug_13178_wide_cardnumber.sql new file mode 100644 index 0000000000..7f3e23b9a4 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_13178_wide_cardnumber.sql @@ -0,0 +1,6 @@ +ALTER TABLE borrowers MODIFY cardnumber varchar(32); +ALTER TABLE borrower_modifications MODIFY cardnumber varchar(32); +ALTER TABLE deletedborrowers MODIFY cardnumber varchar(32); +ALTER TABLE deletedborrowers MODIFY cardnumber varchar(32); +ALTER TABLE pending_offline_operations MODIFY cardnumber varchar(32); +ALTER TABLE tmp_holdsqueue MODIFY cardnumber varchar(32); -- 2.39.5