[Koha-bugs] [Bug 19482] Elasticsearch - prevent removal / editing of required indexes

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Nov 3 16:14:45 CET 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19482

--- Comment #70 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
This is what I had in mind.

@ admin/searchengine/elasticsearch/mappings.pl:119 @ if ( $op eq 'edit' ) {
             }
             elsif ($field_weight <= 0 || !looks_like_number($field_weight)) {
                 push @messages, { type => 'error', code =>
'invalid_field_weight', 'weight' => $field_weight };
+                $errors++;
             }
             else {
                 $search_field->weight($field_weight);
@ admin/searchengine/elasticsearch/mappings.pl:165 @ if ( $op eq 'edit' ) {
                 search => $mapping_search
             });
         }
-        push @messages, { type => 'error', code => 'missing_mandatory_fields'
} if $mandatory_after < $mandatory_before;
+        if ( $mandatory_after < $mandatory_before ) {
+            push @messages, { type => 'error', code =>
'missing_mandatory_fields' };
+            $error++;
+        }
     };
-    if ($@ || @messages) {
+    if ($@ || $errors) {
         push @messages, { type => 'error', code => 'error_on_update', message
=> $@, };
         $schema->storage->txn_rollback;
     } else {

Will see later if we need it.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list