Bug 29374 - searchResults explodes if biblio record has been deleted
Summary: searchResults explodes if biblio record has been deleted
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
: 30386 (view as bug list)
Depends on: 3142
Blocks:
  Show dependency treegraph
 
Reported: 2021-10-29 13:40 UTC by Jonathan Druart
Modified: 2023-06-08 22:26 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.15


Attachments
Bug 29374: Don't crash if search engine returns a deleted record (891 bytes, patch)
2021-10-29 13:41 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2021-10-29 13:40:25 UTC
From commit 1ad0e172cddce560afcc23579948d0c4a1eca71c
     Bug 3142: Use filter_by_for_holds where holdability is calculated

+            $can_place_holds = $biblio_object->items->filter_by_for_hold()->count;

This is exploding early in C4::Search::searchResults if the record is indexed but deleted from the DB.


Can't call method "items" on an undefined value at /kohadevbox/koha/C4/Search.pm line 2000                                                                                                                                   C4::Search::searchResults('HASH(0x55dc9a4076c0)', 'kw,wrdl: d', 432, 20, 0, undef, 'ARRAY(0x55dc9a3757e8)', 'HASH(0x55dc99f94a50)') called at /kohadevbox/koha/opac/opac-search.pl line 613
Comment 1 Jonathan Druart 2021-10-29 13:41:13 UTC
Created attachment 127096 [details] [review]
Bug 29374: Don't crash if search engine returns a deleted record
Comment 2 Jonathan Druart 2021-10-29 13:49:00 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 3 Nick Clemens 2022-05-12 19:29:37 UTC
*** Bug 30386 has been marked as a duplicate of this bug. ***
Comment 4 Andrew Fuerste-Henry 2022-05-29 15:47:40 UTC
Pushed to 21.05.x for 21.05.15