Bugzilla – Attachment 132328 Details for
Bug 25375
Elasticsearch: Limit on available items does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25375: Get biblionumber from the correct MARC field
Bug-25375-Get-biblionumber-from-the-correct-MARC-f.patch (text/plain), 1.54 KB, created by
Nick Clemens (kidclamp)
on 2022-03-28 13:41:58 UTC
(
hide
)
Description:
Bug 25375: Get biblionumber from the correct MARC field
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-03-28 13:41:58 UTC
Size:
1.54 KB
patch
obsolete
>From 9a29562ce55f8d4fc85434e7f5861d8f76fd946f Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 4 Sep 2020 12:25:17 +0400 >Subject: [PATCH] Bug 25375: Get biblionumber from the correct MARC field > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/SearchEngine/Elasticsearch.pm | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index 323a2e2b9b..51c49a5aed 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -30,6 +30,7 @@ use Koha::SearchMarcMaps; > use Koha::Caches; > use C4::Heading; > use C4::AuthoritiesMarc qw( GuessAuthTypeCode ); >+use C4::Biblio; > > use Carp qw( carp croak ); > use Clone qw( clone ); >@@ -773,7 +774,10 @@ sub marc_records_to_documents { > > # Check if there is at least one available item > if ($self->index eq $BIBLIOS_INDEX) { >- my $biblio = Koha::Biblios->find($record->field('001')->data); >+ my ($tag, $code) = C4::Biblio::GetMarcFromKohaField('biblio.biblionumber'); >+ my $field = $record->field($tag); >+ my $biblionumber = $field->is_control_field ? $field->data : $field->subfield($code); >+ my $biblio = Koha::Biblios->find($biblionumber); > my $items = $biblio->items; > my $available = 0; > while (my $item = $items->next) { >-- >2.30.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 25375
:
104356
|
109647
|
109659
|
109660
|
109951
|
109952
|
109953
|
109954
|
131310
|
131311
|
131312
|
131313
|
132327
|
132328
|
132329
|
132330
|
138800
|
138802
|
138803
|
140053
|
140054
|
140055
|
140056
|
140057
|
140572
|
140899
|
140900
|
140979