From 64ce8d88fa231a78731030f9781d3f6b8a319f16 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 7 Mar 2023 12:21:12 +0000 Subject: [PATCH] Bug 32711: Fix biblio embeds We need to drop the embed part of the args we pass to biblioitem else we end up with some very strange behaviours on the acquisitions endpoint. Signed-off-by: Silvia Meakins --- Koha/Biblio.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index eb4d5d3cec..5501b04492 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -1259,6 +1259,10 @@ sub to_api { my ($self, $args) = @_; my $response = $self->SUPER::to_api( $args ); + + $args = defined $args ? {%$args} : {}; + delete $args->{embed}; + my $biblioitem = $self->biblioitem->to_api( $args ); return { %$response, %$biblioitem }; -- 2.41.0