From 2c51799a8a37c68db9f1b4cb5496b74ac0c574d8 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 17 Jul 2023 10:59:26 +0000 Subject: [PATCH] Bug 33270: (QA follow-up) Do not change param hashref Might just be a theoretical thing now, but safer to clone. Test plan: Run t/db_dependent/Koha/Biblio/Metadata.t Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi (cherry picked from commit cfbe8daf2118f0ecdeea13ef866e86d2e905b686) Signed-off-by: Martin Renvoize (cherry picked from commit 32db2823b89ae7250dbd35d5931f682e9a6ce4e2) Signed-off-by: Matt Blenkinsop --- Koha/Biblio/Metadata.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Biblio/Metadata.pm b/Koha/Biblio/Metadata.pm index 448a08b70f..d5bfea5cd0 100644 --- a/Koha/Biblio/Metadata.pm +++ b/Koha/Biblio/Metadata.pm @@ -149,6 +149,7 @@ Will return undef if the record cannot be built sub record_strip_nonxml { my ( $self, $params ) = @_; + $params //= {}; my $record; my $marcxml_error; @@ -166,8 +167,7 @@ sub record_strip_nonxml { return; } - $params->{record} = $record; - return $self->record($params); + return $self->record( { %$params, record => $record } ); } =head2 Internal methods -- 2.39.5