Bugzilla – Attachment 169380 Details for
Bug 37425
Deletion of bibliographic record can cause search errors
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
Bug-37425-Check-for-existence-of-biblio-object-bef.patch (text/plain), 1.73 KB, created by
Nick Clemens (kidclamp)
on 2024-07-22 19:49:54 UTC
(
hide
)
Description:
Bug 37425: Check for existence of biblio object before fetching cover images
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-07-22 19:49:54 UTC
Size:
1.73 KB
patch
obsolete
>From 46259fb5f6a7e3ef717dca763d7e17eab1027de3 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 22 Jul 2024 19:46:33 +0000 >Subject: [PATCH] Bug 37425: Check for existence of biblio object before > fetching cover images > >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 LocalCoverImages > 2 - Perform a search in staff 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 /usr/share/koha/intranet/cgi-bin/catalogue/search.pl line 671. > 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 >--- > catalogue/search.pl | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 7c9bb221260..ebb78bcfb6e 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -668,7 +668,8 @@ for (my $i=0;$i<@servers;$i++) { > } > > if ( C4::Context->preference('LocalCoverImages') ) { >- $line->{has_local_cover_image} = $line->{biblio_object}->cover_images->count; >+ $line->{has_local_cover_image} = >+ $line->{biblio_object} ? $line->{biblio_object}->cover_images->count : 0; > } > } > my( $page_numbers, $hits_to_paginate, $pages, $current_page_number, $previous_page_offset, $next_page_offset, $last_page_offset ) = >-- >2.39.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 37425
:
169380
|
169425
|
169495