From b6eeffb79fb7a5f05652d5a823eac3b7317e768b Mon Sep 17 00:00:00 2001 From: Jacob O'Mara Date: Wed, 25 Mar 2026 14:41:45 +0000 Subject: [PATCH] Bug 17387: (follow-up) fix embed items on get deleted biblio Add x-koha-embed parameter to GET /deleted/biblios/{biblio_id} and use $c->objects->to_api() to properly handle embedding items. Signed-off-by: Lucas Gass --- Koha/REST/V1/DeletedBiblios.pm | 2 +- api/v1/swagger/paths/deleted_biblios.yaml | 10 ++++++++++ .../prog/en/modules/tools/restore-records.tt | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Koha/REST/V1/DeletedBiblios.pm b/Koha/REST/V1/DeletedBiblios.pm index 8ba90026c0..73af99740b 100644 --- a/Koha/REST/V1/DeletedBiblios.pm +++ b/Koha/REST/V1/DeletedBiblios.pm @@ -59,7 +59,7 @@ sub get { if ( $c->req->headers->accept =~ m/application\/json/ ) { return $c->render( status => 200, - json => $biblio->to_api + json => $c->objects->to_api($biblio), ); } else { my $metadata = $biblio->metadata; diff --git a/api/v1/swagger/paths/deleted_biblios.yaml b/api/v1/swagger/paths/deleted_biblios.yaml index cf290da778..22fe8f8e19 100644 --- a/api/v1/swagger/paths/deleted_biblios.yaml +++ b/api/v1/swagger/paths/deleted_biblios.yaml @@ -81,6 +81,16 @@ summary: Get deleted biblio parameters: - $ref: "../swagger.yaml#/parameters/biblio_id_pp" + - name: x-koha-embed + in: header + required: false + description: Embed list sent as a request header + type: array + items: + type: string + enum: + - items + collectionFormat: csv produces: - application/json - application/marcxml+xml diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/restore-records.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/restore-records.tt index 607d05415f..baceb567d0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/restore-records.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/restore-records.tt @@ -576,6 +576,7 @@ url: "/api/v1/deleted/biblios/" + biblio_id, type: "GET", headers: { + "Accept": "application/json", "x-koha-embed": "items", }, success: function (biblio) {