From f47e7425b394132a101bea5b7897ce9c689863c9 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 23 Apr 2025 12:16:13 +0000 Subject: [PATCH] Bug 39710: Handle deleted biblios in holds history To test: - place a hold - cancel the hold - look in patron hold history, see the title - delete the biblio - reload patron hold history, error [2025/04/23 11:43:28] [WARN] OpenAPI >>> GET api/v1/patrons/5/holds [{"message":"Expected integer - got null.","path":"\/body\/3\/biblio_id"},{"message":"Expected integer - got null.","path":"\/body\/4\/biblio_id"}] - apply patch, yarn build, restart_all - reload patron hold history - success - enable OPACHoldsHistory preference - sign in to OPAC as patron - confirm holds history can be loaded Signed-off-by: Roman Dolny Signed-off-by: Matt Blenkinsop --- api/v1/swagger/definitions/hold.yaml | 4 +++- .../intranet-tmpl/prog/en/modules/members/holdshistory.tt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/v1/swagger/definitions/hold.yaml b/api/v1/swagger/definitions/hold.yaml index 2ba3367e04f..48dadf8a5fb 100644 --- a/api/v1/swagger/definitions/hold.yaml +++ b/api/v1/swagger/definitions/hold.yaml @@ -14,7 +14,9 @@ properties: format: date description: The date the hold was placed biblio_id: - type: integer + type: + - integer + - "null" description: Internal biblio identifier deleted_biblio_id: type: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt index 7730c8a4057..c92931f13d3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt @@ -222,7 +222,7 @@ searchable: true, orderable: true, render: function (data, type, row, meta) { - return row.biblio.author; + return row.biblio ? row.biblio.author : "" ; } }, { -- 2.48.1