Bug 41870

Summary: Warning "Use of uninitialized value $borrowernumber" in opac-detail.pl
Product: Koha Reporter: Janusz Kaczmarek <januszop>
Component: OPACAssignee: Janusz Kaczmarek <januszop>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low    
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: Sponsored Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 41870: Warning "Use of uninitialized value $borrowernumber" in opac-detail.pl
Bug 41870: Warning "Use of uninitialized value $borrowernumber" in opac-detail.pl

Description Janusz Kaczmarek 2026-02-18 10:40:57 UTC
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.
Comment 1 Janusz Kaczmarek 2026-02-18 10:46:51 UTC
Created attachment 193340 [details] [review]
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
Comment 2 Roman Dolny 2026-02-18 17:41:28 UTC
Created attachment 193363 [details] [review]
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 <roman.dolny@jezuici.pl>