Bugzilla – Attachment 58024 Details for
Bug 17196
Move marcxml out of the biblioitems table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 17196: Fix query builder for item search
SIGNED-OFF-Bug-17196-Fix-query-builder-for-item-se.patch (text/plain), 2.83 KB, created by
Josef Moravec
on 2016-12-07 21:24:57 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 17196: Fix query builder for item search
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2016-12-07 21:24:57 UTC
Size:
2.83 KB
patch
obsolete
>From ebdd64153e042d6c38a3324cddb570a8662b1b2e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 25 Aug 2016 13:24:19 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 17196: Fix query builder for item search > >The item search needs to join on biblio_metadata to allow search on >marcxml field > >Test plan: >Launch complex item searches (using marc fields). > >Signed-off-by: Mason James <mtj@kohaaloha.com> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/Items.pm | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index e02da3b..b435fee 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -112,6 +112,7 @@ This module contains an API for manipulating item > records in Koha, and is used by cataloguing, circulation, > acquisitions, and serials management. > >+# FIXME This POD is not up-to-date > A Koha item record is stored in two places: the > items table and embedded in a MARC tag in the XML > version of the associated bib record in C<biblioitems.marcxml>. >@@ -1304,7 +1305,6 @@ If this is set, it is set to C<One Order>. > sub GetItemsInfo { > my ( $biblionumber ) = @_; > my $dbh = C4::Context->dbh; >- # note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance. > require C4::Languages; > my $language = C4::Languages::getlanguage(); > my $query = " >@@ -2659,7 +2659,7 @@ sub _SearchItems_build_where_fragment { > $sqlfield = 'more_subfields_xml'; > $xpath = '//record/datafield/subfield[@code="' . $marcsubfield . '"]'; > } else { >- $sqlfield = 'marcxml'; >+ $sqlfield = 'metadata'; # From biblio_metadata > if ($marcfield < 10) { > $xpath = "//record/controlfield[\@tag=\"$marcfield\"]"; > } else { >@@ -2768,11 +2768,16 @@ sub SearchItems { > FROM items > LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber > LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber >+ LEFT JOIN biblio_metadata ON biblio_metadata.biblionumber = biblio.biblionumber >+ WHERE 1 > }; > if (defined $where_str and $where_str ne '') { >- $query .= qq{ WHERE $where_str }; >+ $query .= qq{ AND $where_str }; > } > >+ $query .= q{ AND biblio_metadata.format = 'marcxml' AND biblio_metadata.marcflavour = ? }; >+ push @where_args, C4::Context->preference('marcflavour'); >+ > my @columns = Koha::Database->new()->schema()->resultset('Item')->result_source->columns; > push @columns, Koha::Database->new()->schema()->resultset('Biblio')->result_source->columns; > push @columns, Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns; >-- >2.1.4
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 17196
:
54910
|
54911
|
54912
|
54913
|
54914
|
54918
|
55856
|
55857
|
55858
|
55859
|
55860
|
55904
|
55905
|
55906
|
55907
|
55908
|
55921
|
55922
|
55950
|
55951
|
56038
|
57835
|
57836
|
57837
|
57838
|
57839
|
57840
|
57841
|
57842
|
58000
|
58007
|
58008
|
58023
|
58024
|
58025
|
58026
|
58027
|
58028
|
58029
|
58030
|
58031
|
58032
|
58037
|
58038
|
58039
|
58040
|
58041
|
58042
|
58043
|
58044
|
58045
|
58046
|
58047
|
58048
|
58504
|
58505
|
58506
|
58507
|
58508
|
58509
|
58510
|
58511
|
58512
|
58513
|
58514
|
58516
|
58517
|
58923
|
58924
|
58925
|
58926
|
58927
|
58928
|
58929
|
58930
|
58931
|
58932
|
58933
|
58934
|
58935
|
58936
|
58937
|
58938
|
58939
|
58943
|
58946
|
58947