Bug 34280: Fix warning in logs when saving patron details

If a patron has no valid email address then a warning message appears in the logs when saving:

"Use of uninitialized value $email in string ne at /kohadevbox/koha/Koha/Patron.pm line 1445."

This patch fixes that error by removing an unnescessary string ne

Test plan:
1) Create/choose a patron with no email addresses
2) On the patron record in the page section for Contact information, click edit
3) Now click save
4) The warning above should appear in the logs
5) Apply patch
6) Repeat steps 2 and 3
7) The warning should no longer appear

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Matt Blenkinsop 2023-07-14 14:11:28 +00:00 committed by Tomas Cohen Arazi
parent 3cb77a590b
commit 0cf5dfcbd8
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 1 additions and 1 deletions

View File

@ -1442,7 +1442,7 @@ sub first_valid_email_address {
C4::Context->preference('EmailFieldPrecedence');
for my $field (@fields) {
$email = $self->$field;
last if ( $email ne q{} );
last if ( $email );
}
return $email;