Bug 40403: Remove warning from Circulation_holdsqueue.t

Use of uninitialized value in addition (+) at /kohadevbox/koha/C4/Biblio.pm line 3049.

The context is:

3045     my $current_issues = $biblioitem->totalissues // 0;
3046     if ( defined $value ) {
3047         $totalissues = $value;
3048     } else {
3049         $totalissues = $biblioitem->totalissues + $increase;
3050     }
3051     return 0 if $current_issues == $totalissues;    # No need to update if no changes

It feels correct to use $current_issues to suppress the warning

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2025-07-16 10:42:18 +02:00 committed by Lucas Gass
parent b8de89eaaa
commit 5661df2f70
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 3 additions and 2 deletions

View File

@ -3046,7 +3046,7 @@ sub UpdateTotalIssues {
if ( defined $value ) {
$totalissues = $value;
} else {
$totalissues = $biblioitem->totalissues + $increase;
$totalissues = $current_issues + $increase;
}
return 0 if $current_issues == $totalissues; # No need to update if no changes

View File

@ -17,7 +17,8 @@
use Modern::Perl;
use Test::More tests => 1;
use Test::More tests => 2;
use Test::NoWarnings;
use Test::MockModule;
use C4::Circulation qw( AddIssue AddReturn );