Bugzilla – Attachment 192519 Details for
Bug 35612
Record branch context in accountlines.branchcode for OVERDUE, LOST, and PROCESSING fees
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35612: (QA follow-up) Fix uninitialized value warnings
27bbbda.patch (text/plain), 1.72 KB, created by
Martin Renvoize (ashimema)
on 2026-02-05 08:54:04 UTC
(
hide
)
Description:
Bug 35612: (QA follow-up) Fix uninitialized value warnings
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-02-05 08:54:04 UTC
Size:
1.72 KB
patch
obsolete
>From 27bbbda6e7147be2850bf1d544f3fcecfa2c7c71 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Thu, 5 Feb 2026 08:10:41 +0000 >Subject: [PATCH] Bug 35612: (QA follow-up) Fix uninitialized value warnings > >When LostChargesControl system preference is not set (undefined), >the code was generating 'Use of uninitialized value' warnings >when comparing $lost_control_pref in string equality checks. > >This adds defined checks before the comparisons to handle the >case where the preference is undefined, treating it the same as >'ItemHomeLibrary' (the default). > >Test plan: >1. Run prove t/db_dependent/Circulation.t >2. Verify all tests pass without warnings >--- > C4/Accounts.pm | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index cece86c7c41..b9c19a4adc7 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -82,11 +82,11 @@ sub chargelostitem { > > my $lost_control_pref = C4::Context->preference('LostChargesControl'); > my $lost_control_branch; >- if ( $lost_control_pref eq 'PatronLibrary' ) { >+ if ( defined $lost_control_pref && $lost_control_pref eq 'PatronLibrary' ) { > $lost_control_branch = $patron->branchcode; >- } elsif ( $lost_control_pref eq 'PickupLibrary' ) { >+ } elsif ( defined $lost_control_pref && $lost_control_pref eq 'PickupLibrary' ) { > $lost_control_branch = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; >- } else { # $lost_control_pref eq 'ItemHomeLibrary' >+ } else { # $lost_control_pref eq 'ItemHomeLibrary' or undefined > $lost_control_branch = > ( C4::Context->preference('HomeOrHoldingBranch') eq 'homebranch' ) > ? $item->homebranch >-- >2.52.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35612
:
186567
|
186568
|
186569
|
186570
|
186571
|
187919
|
187920
|
187921
|
187922
|
189137
|
192345
|
192346
|
192347
|
192348
|
192349
|
192385
|
192386
|
192387
|
192388
|
192389
|
192390
|
192497
|
192498
|
192499
|
192500
|
192501
|
192502
|
192513
|
192514
|
192515
|
192516
|
192517
|
192518
| 192519 |
192520
|
192521
|
192522