Bug 40410: Remove warning from Letters.

t/db_dependent/Letters.t .. 95/104 Use of uninitialized value in string eq at /kohadevbox/koha/Koha/Patron.pm line 389.

contactname can be NULL in DB.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2025-07-16 12:39:23 +02:00 committed by Lucas Gass
parent 25277e8a4d
commit 45493d0f06
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 3 additions and 2 deletions

View File

@ -388,7 +388,7 @@ sub store {
if ( C4::Context->preference('ChildNeedsGuarantor')
and ( $self->is_child or $self->category->can_be_guarantee )
and $self->contactname eq ""
and ( !defined $self->contactname || $self->contactname eq "" )
and !@$guarantors )
{
Koha::Exceptions::Patron::Relationship::NoGuarantor->throw();

View File

@ -19,7 +19,8 @@
use Modern::Perl;
use File::Basename qw(dirname);
use Test::More tests => 104;
use Test::More tests => 105;
use Test::NoWarnings;
use Test::MockModule;
use Test::Warn;