From 344306ee282b4581ec954ae3f4a962c04392ade3 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Fri, 8 Mar 2019 07:34:09 +0000 Subject: [PATCH] Bug 18235: (QA follow-up) Series facet name after rebase Bug 19575 changes many field names so "se" facet field became "title-series" --- Koha/SearchEngine/Elasticsearch.pm | 2 +- .../mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl | 2 +- .../prog/en/modules/admin/searchengine/elasticsearch/mappings.tt | 2 +- t/db_dependent/Koha_Elasticsearch.t | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm index 4db18530f4..1c86b9552f 100644 --- a/Koha/SearchEngine/Elasticsearch.pm +++ b/Koha/SearchEngine/Elasticsearch.pm @@ -986,7 +986,7 @@ sub get_facetable_fields { # These should correspond to the ES field names, as opposed to the CCL # things that zebra uses. - my @search_field_names = qw( author itype location su-geo se subject ccode holdingbranch homebranch ); + my @search_field_names = qw( author itype location su-geo title-series subject ccode holdingbranch homebranch ); my @faceted_fields = Koha::SearchFields->search( { name => { -in => \@search_field_names }, facet_order => { '!=' => undef } }, { order_by => ['facet_order'] } ); diff --git a/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl b/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl index fd5ee93ff2..c8e66b9202 100644 --- a/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl +++ b/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl @@ -8,7 +8,7 @@ if( CheckVersion( $DBversion ) ) { $dbh->do("UPDATE search_field SET facet_order=2 WHERE name='itype'"); $dbh->do("UPDATE search_field SET facet_order=3 WHERE name='location'"); $dbh->do("UPDATE search_field SET facet_order=4 WHERE name='su-geo'"); - $dbh->do("UPDATE search_field SET facet_order=5 WHERE name='se'"); + $dbh->do("UPDATE search_field SET facet_order=5 WHERE name='title-series'"); $dbh->do("UPDATE search_field SET facet_order=6 WHERE name='subject'"); $dbh->do("UPDATE search_field SET facet_order=7 WHERE name='ccode'"); $dbh->do("UPDATE search_field SET facet_order=8 WHERE name='holdingbranch'"); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt index 7625455522..2305823e97 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt @@ -364,7 +364,7 @@ a.add, a.delete { [% CASE 'itype' %]Item Types [% CASE 'location' %]Locations [% CASE 'su-geo' %]Places - [% CASE 'se' %]Series + [% CASE 'title-series' %]Series [% CASE 'subject' %]Topics [% CASE 'ccode' %]Collections [% CASE 'holdingbranch' %]Holding libraries diff --git a/t/db_dependent/Koha_Elasticsearch.t b/t/db_dependent/Koha_Elasticsearch.t index 6a34eb0d73..1493862f74 100644 --- a/t/db_dependent/Koha_Elasticsearch.t +++ b/t/db_dependent/Koha_Elasticsearch.t @@ -75,8 +75,8 @@ subtest 'get_facetable_fields() tests' => sub { $builder->build({ source => 'SearchField', value => { - name => 'se', - label => 'se', + name => 'title-series', + label => 'titles-series', type => 'string', facet_order => 4 } @@ -118,7 +118,7 @@ subtest 'get_facetable_fields() tests' => sub { is($faceted_fields[1]->facet_order, 2); is($faceted_fields[2]->name, 'itype'); is($faceted_fields[2]->facet_order, 3); - is($faceted_fields[3]->name, 'se'); + is($faceted_fields[3]->name, 'title-series'); is($faceted_fields[3]->facet_order, 4); is($faceted_fields[4]->name, 'su-geo'); is($faceted_fields[4]->facet_order, 5); -- 2.11.0