Bugzilla – Attachment 165813 Details for
Bug 35138
Enable configuration of facets with Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35138: Mark DisplayLibraryFacets as zebra only
Bug-35138-Mark-DisplayLibraryFacets-as-zebra-only.patch (text/plain), 3.72 KB, created by
Jonathan Druart
on 2024-04-29 21:07:01 UTC
(
hide
)
Description:
Bug 35138: Mark DisplayLibraryFacets as zebra only
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-04-29 21:07:01 UTC
Size:
3.72 KB
patch
obsolete
>From 4ae018ca7d75a7a1725c7ca748f9e632327e0369 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 22 Mar 2024 09:53:47 +0100 >Subject: [PATCH] Bug 35138: Mark DisplayLibraryFacets as zebra only > >We can know add/remove homelibrary and holdinglibray from the config >page, this syspref is no longer needed for ES > >Sponsored-by: The Research University in the Helmholtz Association (KIT) >Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../Elasticsearch/QueryBuilder.pm | 11 ----------- > .../data/mysql/atomicupdate/bug_35138.pl | 19 +++++++++++++++++-- > .../modules/admin/preferences/searching.pref | 1 + > 3 files changed, 18 insertions(+), 13 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 5c7c9b0d61d..ac161e50fd7 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -233,17 +233,6 @@ sub build_query { > $res->{aggregations}->{$name} = { terms => { field => "${name}__facet" , size => $size } }; > }; > >- >- # FIXME We need a way to show/hide the facet individually >- #my $display_library_facets = C4::Context->preference('DisplayLibraryFacets'); >- #if ( $display_library_facets eq 'both' >- # or $display_library_facets eq 'home' ) { >- # $res->{aggregations}{homebranch} = { terms => { field => "homebranch__facet", size => $size } }; >- #} >- #if ( $display_library_facets eq 'both' >- # or $display_library_facets eq 'holding' ) { >- # $res->{aggregations}{holdingbranch} = { terms => { field => "holdingbranch__facet", size => $size } }; >- #} > $res = _rebuild_to_es_advanced_query($res) if @$es_advanced_searches ; > return $res; > } >diff --git a/installer/data/mysql/atomicupdate/bug_35138.pl b/installer/data/mysql/atomicupdate/bug_35138.pl >index 14b48246faa..224a9b0aca8 100755 >--- a/installer/data/mysql/atomicupdate/bug_35138.pl >+++ b/installer/data/mysql/atomicupdate/bug_35138.pl >@@ -27,7 +27,22 @@ return { > } > > $sth->execute( 'Collections', 'ccode', 'collection-code'); >- $sth->execute( 'Holding libraries', 'holdingbranch', 'holdinglibrary'); >- $sth->execute( 'Home libraries', 'homebranch', 'homelibrary'); >+ >+ # Deal with DisplayLibraryFacets >+ my ($DisplayLibraryFacets) = $dbh->selectrow_array(q{ >+ SELECT value FROM systempreferences WHERE variable='DisplayLibraryFacets' >+ }); >+ my ($homebranch, $holdingbranch); >+ if ( $DisplayLibraryFacets eq 'both' ) { >+ $homebranch = 1; >+ $holdingbranch = 1; >+ } elsif ( $DisplayLibraryFacets eq 'holding' ) { >+ $holdingbranch = 1; >+ } elsif ( $DisplayLibraryFacets eq 'home' ) { >+ $homebranch = 1; >+ } >+ $sth->execute( 'Holding libraries', 'holdingbranch', 'holdinglibrary') if $holdingbranch; >+ $sth->execute( 'Home libraries', 'homebranch', 'homelibrary') if $homebranch; >+ > }, > }; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >index e0db164b917..da202d7e1ef 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >@@ -283,6 +283,7 @@ Searching: > home: "home library" > holding: "holding library" > both: "both home and holding library" >+ - (Zebra only). > - > - Truncate facets length to > - pref: FacetLabelTruncationLength >-- >2.34.1
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 35138
:
163133
|
163680
|
163681
|
163682
|
163683
|
163684
|
163896
|
163897
|
163898
|
163899
|
163900
|
164811
|
164812
|
164813
|
164814
|
164815
|
164816
|
165811
|
165812
| 165813 |
165814
|
165815
|
165816
|
165817
|
165818
|
166402