Bugzilla – Attachment 177105 Details for
Bug 38963
Deletion of bibliographic record can cause search errors in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37425: Check for existence of biblio object before fetching cover images at OPAC
0001-Bug-37425-Check-for-existence-of-biblio-object-befor.patch (text/plain), 1.61 KB, created by
Fridolin Somers
on 2025-01-24 11:31:12 UTC
(
hide
)
Description:
Bug 37425: Check for existence of biblio object before fetching cover images at OPAC
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2025-01-24 11:31:12 UTC
Size:
1.61 KB
patch
obsolete
>From e6f86e47bf4d37d67d2e6f9025f8d56f804385ed Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 24 Jan 2025 12:25:46 +0100 >Subject: [PATCH] Bug 37425: Check for existence of biblio object before > fetching cover images at OPAC > >This patch simply adds a conditional to ensure the biblio object has been retrieved and assumes no cover images otherwise > >To test: > 1 - Enable system preference OPACLocalCoverImages > 2 - Perform a search in OPAC interface > 3 - Find the biblionumebr for one of the results and delete it via the SQL backend: > DELETE FROM biblio WHERE biblionumber=3; > 4 - Search again. > 5 - KO! > Can't call method "cover_images" on an undefined value at ... > 6 - Reindex, confirm error is gone > 7 - Apply patch > 8 - Search again > 9 - Delete a record from the results via SQL >10 - Reload and confirm no error >11 - Reindex and repeat search and confirm no error >--- > opac/opac-search.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 54eabd8949..d52f96d01a 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -699,7 +699,7 @@ for (my $i=0;$i<@servers;$i++) { > $res->{artreqpossible} = ( $art_req_itypes->{ $res->{itemtype} // q{} } || $art_req_itypes->{ '*' } ) ? 1 : q{}; > > if ( C4::Context->preference('OPACLocalCoverImages') ) { >- $res->{has_local_cover_image} = $res->{biblio_object}->cover_images->count; >+ $res->{has_local_cover_image} = $res->{biblio_object} ? $res->{biblio_object}->cover_images->count : 0; > } > } > >-- >2.47.2 >
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 38963
:
177105
|
177136
|
177207