From f595edc4b0fb3f07c62be63128d1e1469b26d04f Mon Sep 17 00:00:00 2001 From: Janusz Kaczmarek Date: Wed, 18 Feb 2026 10:43:37 +0000 Subject: [PATCH] Bug 41870: Warning "Use of uninitialized value $borrowernumber" in opac-detail.pl Under some circumstances (OPACShowHoldQueueDetails set, hold made, OPAC user not logged in) a warning like: [WARN] Use of uninitialized value $borrowernumber in numeric eq (==) at /kohadevbox/koha/opac/opac-detail.pl line 598. is being generated. Test plan: ========== 1. Set OPACShowHoldQueueDetails to 'Show holds and their priority levels'. 2. From staff interface, place a hold on a record for any borrower. 3. Open a fresh browser (private mode or different browser), confirm that you are not logged in, go to this record. 4. Check the content of plack-opac-error.log. You should see a warning like: [WARN] Use of uninitialized value $borrowernumber in numeric eq (==) at /kohadevbox/koha/opac/opac-detail.pl line 598 5. Apply the patch ; restart_all. 6. Repeat p. 3 & 4. There should be no new warning now. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny --- opac/opac-detail.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index edf609cb02..c0976ad317 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -595,7 +595,7 @@ if ( $show_holds_count || $show_priority ) { $template->param( holds_count => $holds->count ); while ( my $hold = $holds->next ) { $item_reserves{ $hold->itemnumber }++ if $hold->itemnumber; - if ( $show_priority && $hold->borrowernumber == $borrowernumber ) { + if ( $show_priority && $borrowernumber && $hold->borrowernumber == $borrowernumber ) { $has_hold = 1; $hold->itemnumber ? ( $priority{ $hold->itemnumber } = $hold->priority ) -- 2.39.5