Bug 22823: return undef if KohaAdminEmailAddress not exist
I have the feeling that we should return undef here, but can be ignored if someone disagrees. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
027051c938
commit
cd2b79b871
|
|
@ -80,7 +80,8 @@ sub inbound_email_address {
|
|||
$self->branchreplyto
|
||||
|| $self->branchemail
|
||||
|| C4::Context->preference('ReplytoDefault')
|
||||
|| C4::Context->preference('KohaAdminEmailAddress');
|
||||
|| C4::Context->preference('KohaAdminEmailAddress')
|
||||
|| undef;
|
||||
}
|
||||
|
||||
=head3 library_groups
|
||||
|
|
|
|||
|
|
@ -454,7 +454,7 @@ subtest '->get_effective_marcorgcode' => sub {
|
|||
|
||||
subtest '->inbound_email_address' => sub {
|
||||
|
||||
plan tests => 4;
|
||||
plan tests => 5;
|
||||
|
||||
$schema->storage->txn_begin;
|
||||
|
||||
|
|
@ -482,10 +482,13 @@ subtest '->inbound_email_address' => sub {
|
|||
is( $library_1->inbound_email_address, 'reply@mylibrary.com',
|
||||
'Fallback to ReplytoDefault email address when branchreplyto and branchemail are undefined');
|
||||
|
||||
t::lib::Mocks::mock_preference( 'ReplytoDefault', undef );
|
||||
t::lib::Mocks::mock_preference( 'ReplytoDefault', '' );
|
||||
is( $library_1->inbound_email_address, 'admin@mylibrary.com',
|
||||
'Fallback to KohaAdminEmailAddress email address when branchreplyto, branchemail and eplytoDefault are undefined');
|
||||
'Fallback to KohaAdminEmailAddress email address when branchreplyto, branchemail and ReplytoDefault are undefined');
|
||||
|
||||
t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', '' );
|
||||
is( $library_1->inbound_email_address, undef,
|
||||
'Return undef when email address when branchreplyto, branchemail, ReplytoDefault and KohaAdminEmailAddress are undefined');
|
||||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue