From c919e8bfa2fe3176096c7e4da57b81d145c48e6c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 16 Jan 2017 10:07:46 +0100 Subject: [PATCH] Bug 6782: Fix fixup_cardnumber call The fixup_cardnumber subroutine takes only 1 parameter, the cardnumber. This call is wrong and morevover makes a lot of tests fail: t/db_dependent/Letters.t .. 1/79 Can't use an undefined value as a HASH reference at /home/vagrant/kohaclone/C4/Members.pm line 502. This happens because the userenv is not mocked in a lot of test files. Signed-off-by: Kyle M Hall --- C4/Members.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Members.pm b/C4/Members.pm index e7609e5efe..4402ab970b 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -499,7 +499,7 @@ sub AddMember { if ( C4::Context->preference("autoMemberNum") ) { if ( not exists $data{cardnumber} or not defined $data{cardnumber} or $data{cardnumber} eq '' ) { - $data{cardnumber} = fixup_cardnumber( $data{cardnumber}, C4::Context->userenv->{'branch'}, $data{categorycode} ); + $data{cardnumber} = fixup_cardnumber( $data{cardnumber} ); } } -- 2.39.5