From 2edd7ce4c827e47f6930861243ecd034188bc069 Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 5 Mar 2026 05:37:23 +0000 Subject: [PATCH] Bug 38365: Fix t/db_dependent/Koha/Plugins/Valuebuilder_hooks.t This initialises the CSP nonce in the unit test so that t/lib/plugins/Koha/Plugin/TestValuebuilder/test_valuebuilder_popup.tt will get its script element rewritten correctly. --- t/db_dependent/Koha/Plugins/Valuebuilder_hooks.t | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/t/db_dependent/Koha/Plugins/Valuebuilder_hooks.t b/t/db_dependent/Koha/Plugins/Valuebuilder_hooks.t index e2bd6e72059..760a6fdaf5c 100755 --- a/t/db_dependent/Koha/Plugins/Valuebuilder_hooks.t +++ b/t/db_dependent/Koha/Plugins/Valuebuilder_hooks.t @@ -24,6 +24,7 @@ use File::Basename; use C4::Context; use Koha::FrameworkPlugin; +use Koha::ContentSecurityPolicy; use t::lib::Mocks; use t::lib::TestBuilder; @@ -39,6 +40,9 @@ BEGIN { use_ok('Koha::Plugin::TestValuebuilder'); } +my $csp = Koha::ContentSecurityPolicy->new; +$csp->set_nonce(); + my $schema = Koha::Database->new->schema; my $builder = t::lib::TestBuilder->new; -- 2.39.5