Bug 13215: Fix GetLetterTemplates should return default templates if branchcode is not defined
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
parent
eff8f8c0d0
commit
3b6b8a4a1e
|
|
@ -115,7 +115,7 @@ sub GetLetterTemplates {
|
|||
|
||||
my $module = $params->{module};
|
||||
my $code = $params->{code};
|
||||
my $branchcode = $params->{branchcode};
|
||||
my $branchcode = $params->{branchcode} // '';
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $letters = $dbh->selectall_hashref(
|
||||
q|
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use Modern::Perl;
|
||||
use Test::More tests => 6;
|
||||
use Test::More tests => 7;
|
||||
|
||||
use C4::Context;
|
||||
use C4::Letters qw( GetLetterTemplates );
|
||||
|
|
@ -123,3 +123,8 @@ is( scalar( keys %$letter_templates ),
|
|||
1, '1 template should exist for circulation CPL code1' );
|
||||
is( exists( $letter_templates->{email} ),
|
||||
1, 'The mtt should be email for circulation CPL code1' );
|
||||
|
||||
$letter_templates = C4::Letters::GetLetterTemplates(
|
||||
{ module => 'circulation', code => 'code1' } );
|
||||
is( scalar( keys %$letter_templates ),
|
||||
2, '2 default templates should exist for circulation code1 (even if branchcode is not given)' );
|
||||
|
|
|
|||
Loading…
Reference in New Issue