https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17885
--- Comment #1 from Olli-Antti Kivilahti <[email protected]> --- Created attachment 58825 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58825&action=edit 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 upserting those entries instead of adding them. Also adds a Koha::SearchMappingManager to manage the complexities of CRUD:ing these search mappings Also adds nice tests to make sure the Manager and the reset_elasticsearch_mappings() keep working as expected. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
