Bugzilla – Attachment 127697 Details for
Bug 29436
Cannot reorder facets in staff interface elasticsearch configuration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29436: ES mappings not saved if zebra is configured
Bug-29436-ES-mappings-not-saved-if-zebra-is-config.patch (text/plain), 3.72 KB, created by
Jonathan Druart
on 2021-11-16 15:06:29 UTC
(
hide
)
Description:
Bug 29436: ES mappings not saved if zebra is configured
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-11-16 15:06:29 UTC
Size:
3.72 KB
patch
obsolete
>From 2a6dbb8d8445555c6467faf900f8cd91ed425033 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 16 Nov 2021 16:04:45 +0100 >Subject: [PATCH] Bug 29436: ES mappings not saved if zebra is configured > >The mappings must be editable even if ES is not turned on yet. > >Using a separate array to store the errors as we are testing for $@ || >@messages. > >There is still something wrong that should be improve, but this patch >should be safe for backport. >--- > admin/searchengine/elasticsearch/mappings.pl | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > >diff --git a/admin/searchengine/elasticsearch/mappings.pl b/admin/searchengine/elasticsearch/mappings.pl >index 35ee78e9f77..b3a05aca643 100755 >--- a/admin/searchengine/elasticsearch/mappings.pl >+++ b/admin/searchengine/elasticsearch/mappings.pl >@@ -50,7 +50,7 @@ unless ( can_load( modules => { 'Koha::SearchEngine::Elasticsearch::Indexer' => > > my $index = $input->param('index') || 'biblios'; > my $op = $input->param('op') || 'list'; >-my @messages; >+my ( @messages, @errors ); > push @messages, { type => 'message', code => 'elasticsearch_disabled' } > if ( C4::Context->preference('SearchEngine') ne 'Elasticsearch' ); > >@@ -68,7 +68,7 @@ my $update_mappings = sub { > $indexer->update_mappings(); > } catch { > my $conf = $indexer->get_elasticsearch_params(); >- push @messages, { >+ push @errors, { > type => 'error', > code => 'error_on_update_es_mappings', > message => $_[0], >@@ -124,7 +124,7 @@ if ( $op eq 'edit' ) { > $search_field->weight(undef); > } > elsif ($field_weight <= 0 || !looks_like_number($field_weight)) { >- push @messages, { type => 'error', code => 'invalid_field_weight', 'weight' => $field_weight }; >+ push @errors, { type => 'error', code => 'invalid_field_weight', 'weight' => $field_weight }; > } > else { > $search_field->weight($field_weight); >@@ -170,10 +170,10 @@ if ( $op eq 'edit' ) { > search => $mapping_search > }); > } >- push @messages, { type => 'error', code => 'missing_mandatory_fields' } if $mandatory_after < $mandatory_before; >+ push @errors, { type => 'error', code => 'missing_mandatory_fields' } if $mandatory_after < $mandatory_before; > }; >- if ($@ || @messages) { >- push @messages, { type => 'error', code => 'error_on_update', message => $@, }; >+ if ($@ || @errors) { >+ push @errors, { type => 'error', code => 'error_on_update', message => $@, }; # FIXME $@ can be empty but @errors > $schema->storage->txn_rollback; > } else { > push @messages, { type => 'message', code => 'success_on_update' }; >@@ -203,14 +203,14 @@ for my $index_name (@index_names) { > if (!$indexer->is_index_status_ok) { > my $conf = $indexer->get_elasticsearch_params(); > if ($indexer->is_index_status_reindex_required) { >- push @messages, { >+ push @errors, { > type => 'error', > code => 'reindex_required', > index => $conf->{index_name}, > }; > } > elsif($indexer->is_index_status_recreate_required) { >- push @messages, { >+ push @errors, { > type => 'error', > code => 'recreate_required', > index => $conf->{index_name}, >@@ -277,6 +277,7 @@ while ( my $search_field = $search_fields->next ) { > push @all_search_fields, $search_field_unblessed; > } > >+push @messages, @errors; > $template->param( > indexes => \@indexes, > all_search_fields => \@all_search_fields, >-- >2.25.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 29436
:
127697
|
127824
|
128673