From 40b6f6f1a13f1bad4d7104ac29d5a7e66b701745 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 587eb5af00..986fa182c9 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -1248,6 +1248,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.40.1