[koha-commits] main Koha release repository branch 19.05.x updated. v19.05.07-36-g94b2d5405c

Git repo owner gitmaster at git.koha-community.org
Thu Feb 6 17:01:48 CET 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "main Koha release repository".

The branch, 19.05.x has been updated
       via  94b2d5405c40c31a4c1d60136a1a64ba10529ea8 (commit)
      from  17ba977f50d1f711a5b21d25d9387928afb91825 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 94b2d5405c40c31a4c1d60136a1a64ba10529ea8
Author: Joonas Kylmälä <joonas.kylmala at helsinki.fi>
Date:   Fri Aug 31 15:32:20 2018 +0300

    Bug 17885: Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings throws DBD::mysql Duplicate entry exceptions
    
    When executing
    Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings()
    against populated search engine mappings tables, one gets this
    exception:
    
    DBD::mysql::st execute failed: Duplicate entry '388-73' for key
    'PRIMARY' [for Statement \"INSERT INTO `search_marc_to_field` ( `facet`,
    `search_field_id`, `search_marc_map_id`, `sort`, `suggestible`) VALUES (
    ?, ?, ?, ?, ? )\" with ParamValues: 0='', 1='73', 2='388', 3=undef,
    4=''] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line
    1834.\nDBIx::Class::Storage::DBI::_dbh_execute(): Duplicate entry
    '388-73' for key 'PRIMARY' at /home/koha/Koha/Koha/SearchField.pm line
    38"
    
    This patch fixes this, by first deleting all entries, then adding the
    default ones.
    
    If a subroutine says reset_elasticsearch_mappings(), I expect it to
    reset the elasticsearch mappings without errors.  When writing tests it
    is better to call that one subroutine reset_elasticsearch_mappings
    instead of the bunch of code in
    admin/searchengine/elasticsearch/mappings.pl?op=reset_confirmed
    Also this promotes code reuse.
    
    TEST PLAN:
    
    a. perl -e 'use Koha::SearchEngine::Elasticsearch; Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings'
    b. Run misc/devel/populate_db.pl on an already populated DB and you eventually
    face this problem.
    
    After this patch, step a. works.
    
    This patch is adapted from the original patch made by Olli-Antti
    Kivilahti <olli-antti.kivilahti at jns.fi>.
    
    Signed-off-by: Johanna Raisa <johanna.raisa at gmail.com>
    Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
    Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>
    
    Signed-off-by: Joy Nelson <joy at bywatersolutions.com>
    (cherry picked from commit 0c68b3a171c07025a0bb9e48245444a44b30d196)
    
    Signed-off-by: Lucas Gass <lucas at bywatersolutions.com>

-----------------------------------------------------------------------

Summary of changes:
 Koha/SearchEngine/Elasticsearch.pm           | 3 +++
 admin/searchengine/elasticsearch/mappings.pl | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
main Koha release repository


More information about the koha-commits mailing list