Bug 34280

Summary: Patrons with no email address produce a warning when saving
Product: Koha Reporter: Matt Blenkinsop <matt.blenkinsop>
Component: PatronsAssignee: Matt Blenkinsop <matt.blenkinsop>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: david, emily.lamancusa, fridolin.somers, gmcharlt, kyle.m.hall, pedro.amorim
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.03
Bug Depends on: 29046    
Bug Blocks:    
Attachments: Bug 34280: Fix warning in logs when saving patron details
Bug 34280: Fix warning in logs when saving patron details
Bug 34280: Fix warning in logs when saving patron details
Bug 34280: (QA follow-up) perltidy

Description Matt Blenkinsop 2023-07-14 14:10:39 UTC
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."
Comment 1 Matt Blenkinsop 2023-07-14 14:15:19 UTC
Created attachment 153490 [details] [review]
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
Comment 2 David Nind 2023-07-18 10:57:14 UTC
Created attachment 153587 [details] [review]
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>
Comment 3 David Nind 2023-07-18 10:59:10 UTC
Testing notes (using KTD):

1. For me, the warning only appeared in the logs when editing the contact information for existing patrons. If I created a new patron, the warning message didn't appear in the logs.

2. To view the logs: vi /var/log/koha/kohadev/plack-intranet-error.log
Comment 4 Emily Lamancusa 2023-07-24 16:43:53 UTC
Created attachment 153852 [details] [review]
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>
Comment 5 Emily Lamancusa 2023-07-24 16:43:56 UTC
Created attachment 153853 [details] [review]
Bug 34280: (QA follow-up) perltidy

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 6 Emily Lamancusa 2023-07-24 16:46:53 UTC
Trivial follow-up patch to make perltidy happy. Otherwise, change makes sense and QA tool passes. Passing QA
Comment 7 Tomás Cohen Arazi 2023-07-24 17:56:05 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 8 Fridolin Somers 2023-08-04 02:11:09 UTC
Pushed to 23.05.x for 23.05.03
Comment 9 Fridolin Somers 2023-08-04 02:12:50 UTC
Looks like this has been added by Bug 29046
Comment 10 Pedro Amorim 2023-08-18 11:45:25 UTC
Bug 29046 not in 22.11.x. Not pushing.