Bug 41706 - "Use of uninitialized value..." warning in C4/Record.pm
Summary: "Use of uninitialized value..." warning in C4/Record.pm
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-25 13:16 UTC by Roman Dolny
Modified: 2026-01-25 14:20 UTC (History)
0 users

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41706: "Use of uninitialized value..." warning in C4/Record.pm (1.69 KB, patch)
2026-01-25 14:14 UTC, Roman Dolny
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Dolny 2026-01-25 13:16:24 UTC
The warning:
[WARN] Use of uninitialized value $2 in split
    at /kohadevbox/koha/C4/Record.pm line 924.
appears in the plack-opac-error.log file.

To reproduce in KTD:
1. Observe plack-opac-error.log
2. In OPAC go to record with one word author like Aristophanes,
   Aristotle or Xenophon (biblionumbers: 64, 176, 254)
3. Show it in any of "detail" view (Normal, MARC, ISBD)
4. Warning appears in plack-opac-error.log

It happens during the preparation of data for the "Cite" feature 
in OPAC. The warning appears because of the overlap of two regular 
expression matches - the variable captured from the first regular 
expression match is changed (by the second regular expression match) 
before it is used.
Comment 1 Roman Dolny 2026-01-25 14:14:21 UTC
Created attachment 192011 [details] [review]
Bug 41706: "Use of uninitialized value..." warning in C4/Record.pm

The warning:
[WARN] Use of uninitialized value $2 in split
    at /kohadevbox/koha/C4/Record.pm line 924.
appears in the plack-opac-error.log file.
It happens during the preparation of data for the "Cite" feature
in OPAC for some of author's fields.

To test:
========
1. Observe plack-opac-error.log.
2. In OPAC go to record with one word author like Aristophanes,
   Aristotle or Xenophon (biblionumbers: 64, 176, 254).
3. Show it in any of "detail" view (Normal, MARC, ISBD).
4. Warning appears in plack-opac-error.log.
5. Apply the patch; restart_all.
6. Repeat 2-3. Warning doesn't appear.

Sponsored-by: Ignatianum University in Cracow