Bug 36940

Summary: Resolve two Auth warnings when AutoLocation is enabled having a branch without branchip
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Marcel de Rooy <m.de.rooy>
Status: Pushed to oldstable --- QA Contact: Nick Clemens (kidclamp) <nick>
Severity: trivial    
Priority: P5 - low CC: david, fridolin.somers, lucas, nick
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36944
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes two warnings in the log files when the AutoLocation system preference is enabled and there is a library without an IP address. Warning messages: [WARN] Use of uninitialized value $domain in substitution (s///) at /usr/share/koha/C4/Auth.pm line 1223. [WARN] Use of uninitialized value $domain in regexp compilation at /usr/share/koha/C4/Auth.pm line 1224.
Version(s) released in:
24.11.00,24.05.02,23.11.07
Circulation function:
Attachments: Bug 36940: Resolve two warnings on undefined branchip
Bug 36940: Resolve two warnings on undefined branchip

Description Marcel de Rooy 2024-05-23 08:47:23 UTC
From 22.11 but still on master too:

[2024/05/23 10:37:11] [WARN] Use of uninitialized value $domain in substitution (s///) at /usr/share/koha/C4/Auth.pm line 1199.
[2024/05/23 10:37:11] [WARN] Use of uninitialized value $domain in regexp compilation at /usr/share/koha/C4/Auth.pm line 1200.
Comment 1 Marcel de Rooy 2024-05-23 08:50:57 UTC
These are the master ones:

[2024/05/23 08:50:30] [WARN] Use of uninitialized value $domain in substitution (s///) at /usr/share/koha/C4/Auth.pm line 1222.
[2024/05/23 08:50:30] [WARN] Use of uninitialized value $domain in substitution (s///) at /usr/share/koha/C4/Auth.pm line 1223.
[2024/05/23 08:50:30] [WARN] Use of uninitialized value $domain in regexp compilation at /usr/share/koha/C4/Auth.pm line 1224.
Comment 2 Marcel de Rooy 2024-05-23 08:51:59 UTC
Created attachment 167079 [details] [review]
Bug 36940: Resolve two warnings on undefined branchip

If you enabled AutoLocation and have a branch without ip, this
triggers warnings.

Test plan:
Check logs in this situation with/without this patch by logging out
and in again on staff.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Marcel de Rooy 2024-05-23 09:21:12 UTC
Noticed that turning on AutoLocation will make Auth.t fail. But thats outside the scope of this trivial report.
Comment 4 Marcel de Rooy 2024-05-23 09:22:32 UTC
Trivial: Self SO
Comment 5 Nick Clemens (kidclamp) 2024-05-30 13:36:52 UTC
Created attachment 167274 [details] [review]
Bug 36940: Resolve two warnings on undefined branchip

If you enabled AutoLocation and have a branch without ip, this
triggers warnings.

Test plan:
Check logs in this situation with/without this patch by logging out
and in again on staff.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Martin Renvoize 2024-06-13 13:33:10 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant
Comment 7 Lucas Gass 2024-07-18 17:49:04 UTC
Backported to 24.05.x for upcoming 24.05.02
Comment 8 Fridolin Somers 2024-07-19 07:42:07 UTC
Pushed to 23.11.x for 23.11.07