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>
(cherry picked from commit 1f2dffb43f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Jonathan Druart 2025-07-16 12:39:23 +02:00 committed by Fridolin Somers
parent 75be7ae805
commit 1be5bf75d3
No known key found for this signature in database
GPG Key ID: 9A8E73E2A8B96537
2 changed files with 3 additions and 2 deletions

View File

@ -379,7 +379,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;