From 332a5b6b931279a068f60fda6c2e847b0caa8579 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 Signed-off-by: Martin Renvoize --- Koha/Biblio.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index f0d0ffc8b0..125e5df850 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -1294,6 +1294,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