Bug 39710

Summary: Cannot load holds history if there are deleted biblios
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: PatronsAssignee: Nick Clemens (kidclamp) <nick>
Status: Pushed to stable --- QA Contact: Matt Blenkinsop <matt.blenkinsop>
Severity: normal    
Priority: P5 - low CC: andrew, gmcharlt, kyle.m.hall, paul.derscheid
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.05.00,24.11.05
Circulation function:
Bug Depends on:    
Bug Blocks: 38395    
Attachments: Bug 39710: Unit test
Bug 39710: Handle deleted biblios in holds history
Bug 39710: Unit test
Bug 39710: Handle deleted biblios in holds history
Bug 39710: Unit test
Bug 39710: Handle deleted biblios in holds history

Description Nick Clemens (kidclamp) 2025-04-23 12:09:54 UTC
To recreate:
 - 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"}]
Comment 1 Nick Clemens (kidclamp) 2025-04-23 12:18:57 UTC
Created attachment 181367 [details] [review]
Bug 39710: Unit test
Comment 2 Nick Clemens (kidclamp) 2025-04-23 12:18:59 UTC
Created attachment 181368 [details] [review]
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
Comment 3 Roman Dolny 2025-04-23 14:06:15 UTC
Created attachment 181374 [details] [review]
Bug 39710: Unit test

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 4 Roman Dolny 2025-04-23 14:06:18 UTC
Created attachment 181375 [details] [review]
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 <roman.dolny@jezuici.pl>
Comment 5 Matt Blenkinsop 2025-05-01 14:38:10 UTC
Created attachment 181828 [details] [review]
Bug 39710: Unit test

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Comment 6 Matt Blenkinsop 2025-05-01 14:38:13 UTC
Created attachment 181829 [details] [review]
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 <roman.dolny@jezuici.pl>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Comment 7 Katrin Fischer 2025-05-02 06:55:27 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 8 Andrew Fuerste-Henry 2025-05-02 12:06:12 UTC
Can this please be backported to 24.11?
Comment 9 Paul Derscheid 2025-05-26 07:25:39 UTC
Nice work everyone!

Pushed to 24.11.x for 24.11.05