Bug 40388: Remove warning from t/Labels.t

Use of uninitialized value $cn_item in sprintf at /kohadevbox/koha/C4/ClassSplitRoutine/LCC.pm line 53.

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>
(cherry picked from commit 9b0709fb47)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit b8d54707ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Jonathan Druart 2025-07-15 14:48:39 +02:00 committed by Fridolin Somers
parent a74c4daa29
commit d2af4f0da4
No known key found for this signature in database
GPG Key ID: 9A8E73E2A8B96537
2 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ sub split_callnumber {
# lccn examples: 'HE8700.7 .P6T44 1983', 'BS2545.E8 H39 1996';
my @lines = Library::CallNumber::LC->new($cn_item)->components();
unless (scalar @lines && defined $lines[0]) {
Koha::Logger->get->debug(sprintf('regexp failed to match string: %s', $cn_item));
Koha::Logger->get->debug( sprintf( 'regexp failed to match string: %s', $cn_item // q{} ) );
@lines = $cn_item; # if no match, just use the whole string.
}
my $LastPiece = pop @lines;

View File

@ -17,11 +17,11 @@
#
# for context, see http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=2691
use strict;
use warnings;
use Modern::Perl;
use C4::ClassSplitRoutine::LCC qw( split_callnumber );
use Test::More tests => 11;
use Test::More tests => 12;
use Test::NoWarnings;
BEGIN {
use_ok('C4::Labels::Label', qw( _get_text_fields _check_params _guide_box ));