Bugzilla – Attachment 189171 Details for
Bug 41205
Error in Advanced Cataloging editor when z39 source returns undef / empty records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41205: Skip undef records in Z39 response
Bug-41205-Skip-undef-records-in-Z39-response.patch (text/plain), 2.01 KB, created by
Nick Clemens (kidclamp)
on 2025-11-06 13:33:37 UTC
(
hide
)
Description:
Bug 41205: Skip undef records in Z39 response
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-11-06 13:33:37 UTC
Size:
2.01 KB
patch
obsolete
>From 0bde5ae55405bd679b1fa5f5eb0928592e269772 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 6 Nov 2025 13:29:54 +0000 >Subject: [PATCH] Bug 41205: Skip undef records in Z39 response > >This patch simply skips undefined records - this prevents the error >though it doesn't explain why we get undef records here and a Z39 search >from standard cataloging just returns nothing. > >This prevents a breakage of the search. > >To test: >1 - Have LOC defined as a Z39 Source (standard in KTD) >2 - Open the advanced editor >3 - Search for ISBN 9780520401129 >4 - Search explodes, logs like: > AH01215: stderr from /kohadevbox/koha/svc/cataloguing/metasearch: Can't call method "raw" on an undefined value at /kohadevbox/koha/Koha/MetaSearcher.pm line 267., referer: http://localhost:8081/cgi-bin/koha/cataloguing/editor.pl > AH01215: stderr from /kohadevbox/koha/svc/cataloguing/metasearch: Magic number checking on storable file failed at /usr/lib/x86_64-linux-gnu/perl/5.36/Storable.pm line 443, at /kohadevbox/koha/Koha/MetaSearcher.pm line 144., referer: http://localhost:8081/cgi-bin/koha/cataloguing/editor.pl >5 - Must refresh the page to clear the bad error message >6 - Apply patch >7 - Repeat search - no results, LOC says 'Permanent system error' >8 - You can close the results and do a new search >--- > Koha/MetaSearcher.pm | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > >diff --git a/Koha/MetaSearcher.pm b/Koha/MetaSearcher.pm >index c40ce19bd2a..12f0c74acc4 100644 >--- a/Koha/MetaSearcher.pm >+++ b/Koha/MetaSearcher.pm >@@ -262,8 +262,7 @@ sub _start_worker { > } else { > $num_hits = $results->size; > $num_fetched = ( $self->{offset} + $self->{fetch} ) < $num_hits ? $self->{fetch} : $num_hits; >- >- $hits = [ map { $_->raw() } @{ $results->records( $self->{offset}, $num_fetched, 1 ) } ]; >+ $hits = [ map { $_->raw() } grep { defined } @{ $results->records( $self->{offset}, $num_fetched, 1 ) } ]; > } > > if ( !@$hits && $connection && $connection->exception() ) { >-- >2.39.5
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 41205
:
189171
|
189245
|
189253