From 64cc3f9e7f12b0e320c6d321d5e11a79661f82c9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 28 May 2025 16:51:37 +0200 Subject: [PATCH] Bug 40020: Remove warnings from Koha/AdditionalContents.t Test plan: prove t/db_dependent/Koha/AdditionalContents.t should return green --- Koha/AdditionalContents.pm | 2 +- t/db_dependent/Koha/AdditionalContents.t | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Koha/AdditionalContents.pm b/Koha/AdditionalContents.pm index a16089e5247..917538c7bdf 100644 --- a/Koha/AdditionalContents.pm +++ b/Koha/AdditionalContents.pm @@ -73,7 +73,7 @@ location is one of this: sub search_for_display { my ( $self, $params ) = @_; - my $lang = $params->{lang}; + my $lang = $params->{lang} || q{}; # If lang is not default, we will search for entries matching $lang but fallback to default if $lang is not found # Then we need a subquery count in where clause; DBIx::Class/SQL::Abstract does not support it, fallback to literal SQL diff --git a/t/db_dependent/Koha/AdditionalContents.t b/t/db_dependent/Koha/AdditionalContents.t index 6fc01677c04..5ed6fea0550 100755 --- a/t/db_dependent/Koha/AdditionalContents.t +++ b/t/db_dependent/Koha/AdditionalContents.t @@ -19,8 +19,9 @@ use Modern::Perl; -use Test::More tests => 7; +use Test::More tests => 8; use Test::Exception; +use Test::NoWarnings; use Koha::AdditionalContents; use Koha::Database; -- 2.34.1