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>
(cherry picked from commit 45493d0f06)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Jonathan Druart 2025-07-16 12:39:23 +02:00 committed by Paul Derscheid
parent 103c48373e
commit 1f2dffb43f
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
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;