Bugzilla – Attachment 124009 Details for
Bug 28885
OpacBrowseResults can cause errors with bad search indexes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28885: Skip invalid biblios for OpacBrowseResults
Bug-28885-Skip-invalid-biblios-for-OpacBrowseResul.patch (text/plain), 2.00 KB, created by
David Nind
on 2021-08-22 20:51:22 UTC
(
hide
)
Description:
Bug 28885: Skip invalid biblios for OpacBrowseResults
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-08-22 20:51:22 UTC
Size:
2.00 KB
patch
obsolete
>From cfcb6483aeb6e05bf89bf9317e335e3d1cef0e40 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 19 Aug 2021 10:49:34 -0400 >Subject: [PATCH] Bug 28885: Skip invalid biblios for OpacBrowseResults > >If a record is deleted from Koha, but is for some reason not deleted from the search indexes, OpacBrowseResults can cause an ISE if the deleted record is in the search results for any given item. OpacBrowseResults loops through the search results, and checks if there is a biblionumber, but does *not* check to see if a result was pulled from the database for that biblionumber. It simply assumes the result must exist. > >We should be checking to ensure the biblionumber was valid before operating on the biblio object. > >Test Plan: >1) Use zebra for searching >2) Disable koha-indexer >3) Enable OpacBrowseResults >4) Perform a search >5) Delete an item in the search results >6) View on of the remaining items in the search results >7) Note the error >8) Apply this patch >9) Restart plack >10) Reload the page >11) The error should be gone! > >Signed-off-by: David Nind <david@davidnind.com> >--- > opac/opac-detail.pl | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 55a326fe37..a9eb913f00 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -526,6 +526,7 @@ if ($session->param('busc')) { > for (my $j = 0; $j < @arrBiblios; $j++) { > next unless ($arrBiblios[$j]); > $dataBiblioPaging = Koha::Biblios->find( $arrBiblios[$j] ) if ($arrBiblios[$j] != $biblionumber); >+ next unless $dataBiblioPaging; > push @listResults, {index => $j + 1 + $offset, biblionumber => $arrBiblios[$j], title => ($arrBiblios[$j] == $biblionumber)?'':$dataBiblioPaging->title, author => ($arrBiblios[$j] != $biblionumber && $dataBiblioPaging->author)?$dataBiblioPaging->author:'', url => ($arrBiblios[$j] == $biblionumber)?'':'opac-detail.pl?biblionumber=' . $arrBiblios[$j]}; > } > $template->param('listResults' => \@listResults) if (@listResults); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28885
:
123978
|
124009
|
124252