Bug 29374 - searchResults explodes if biblio record has been deleted
Summary: searchResults explodes if biblio record has been deleted
Status: RESOLVED 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:
Depends on: 3142
Blocks:
  Show dependency treegraph
 
Reported: 2021-10-29 13:40 UTC by Jonathan Druart
Modified: 2021-11-05 12:05 UTC (History)
1 user (show)

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


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!