Bug 41742 - Use of uninitialized value in repeat (x)... warning in acqui-home.pl
Summary: Use of uninitialized value in repeat (x)... warning in acqui-home.pl
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-30 20:18 UTC by Roman Dolny
Modified: 2026-01-30 20:29 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

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Dolny 2026-01-30 20:18:24 UTC
The warning:
[WARN] Use of uninitialized value in repeat (x) at /kohadevbox/koha/acqui/acqui-home.pl line 137
appears in the plack-intranet-error.log when entering into Acquisitions module.

To reproduce in ktd:
1. Observe plack-intranet-error.log.
2. In staff interface go to Acquisitions module.
3. Warning appears in plack-intranet-error.log.

It seems that the "depth" key in:
  sprintf( "%s", ">" x $$budget{depth} . $$budget{budget_name} );
has not been set previously.

Several uses of "depth" are in the "CheckBudgetParentPerm" sub, which is probably not called anywhere.

This part of the code is responsible for displaying indents in the list of budgets and funds in the "Fund" drop-down of the Acquisitions module.
So maybe it should be the "budget_level" key or "CheckBudgetParentPerm" should be called?
Comment 1 Roman Dolny 2026-01-30 20:29:30 UTC
Similar situation in:

acqui/acqui-home.pl:        $$budget{budget_display_name} = sprintf( "%s", ">" x $$budget{depth} . $$budget{budget_name} );

acqui/duplicate_orders.pl:            sprintf( "%s", ">" x $$budget{depth} . $$budget{budget_name} );

acqui/histsearch.pl:        $$budget{budget_display_name} = sprintf( "%s", ">" x $$budget{depth} . $$budget{budget_name} );