Bugzilla – Attachment 184125 Details for
Bug 40403
Circulation_holdsqueue.t generates warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40403: Remove warning from Circulation_holdsqueue.t
Bug-40403-Remove-warning-from-Circulationholdsqueu.patch (text/plain), 1.72 KB, created by
Jonathan Druart
on 2025-07-16 08:43:45 UTC
(
hide
)
Description:
Bug 40403: Remove warning from Circulation_holdsqueue.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-07-16 08:43:45 UTC
Size:
1.72 KB
patch
obsolete
>From 08bc7c57b1a999b60d5a30266aa5d1e5ba13160e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 16 Jul 2025 10:42:18 +0200 >Subject: [PATCH] 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 >--- > C4/Biblio.pm | 2 +- > t/db_dependent/Circulation_holdsqueue.t | 3 ++- > 2 files changed, 3 insertions(+), 2 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 3d6a4fca60d..00f481cf965 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -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 > >diff --git a/t/db_dependent/Circulation_holdsqueue.t b/t/db_dependent/Circulation_holdsqueue.t >index 5674fa11aa4..33e2a2f791b 100755 >--- a/t/db_dependent/Circulation_holdsqueue.t >+++ b/t/db_dependent/Circulation_holdsqueue.t >@@ -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 ); >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40403
: 184125