From 2976153907ad2df9ba638530b847c51e787a4694 Mon Sep 17 00:00:00 2001
From: Nick Clemens <nick@bywatersolutions.com>
Date: Fri, 18 May 2018 15:38:53 +0000
Subject: [PATCH] Bug 20073: (follow-up) Correct paths

---
 Koha/SearchEngine/Elasticsearch.pm     | 6 +++---
 debian/templates/koha-conf-site.xml.in | 2 +-
 etc/koha-conf.xml                      | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm
index 0b33c06..0901919 100644
--- a/Koha/SearchEngine/Elasticsearch.pm
+++ b/Koha/SearchEngine/Elasticsearch.pm
@@ -139,7 +139,7 @@ sub get_elasticsearch_settings {
     state $settings = undef;
     if (!defined $settings) {
         my $config_file = C4::Context->config('elasticsearch_index_config');
-        $config_file ||= C4::Context->config('intranetdir') . '/etc/searchengine/elasticsearch/index_config.yaml';
+        $config_file ||= '/etc/koha/searchengine/elasticsearch/index_config.yaml';
         $settings = LoadFile( $config_file );
     }
 
@@ -226,7 +226,7 @@ sub _get_elasticsearch_mapping {
     state $settings = undef;
     if (!defined $settings) {
         my $config_file = C4::Context->config('elasticsearch_field_config');
-        $config_file ||= C4::Context->config('intranetdir') . '/etc/searchengine/elasticsearch/field_config.yaml';
+        $config_file ||= '/etc/koha/searchengine/elasticsearch/field_config.yaml';
         $settings = LoadFile( $config_file );
     }
 
@@ -248,7 +248,7 @@ sub _get_elasticsearch_mapping {
 sub reset_elasticsearch_mappings {
     my ( $reset_fields ) = @_;
     my $mappings_yaml = C4::Context->config('elasticsearch_index_mappings');
-    $mappings_yaml ||= C4::Context->config('intranetdir') . '/etc/searchengine/elasticsearch/mappings.yaml';
+    $mappings_yaml ||= C4::Context->config('intranetdir') . '/admin/searchengine/elasticsearch/mappings.yaml';
     my $indexes = LoadFile( $mappings_yaml );
 
     while ( my ( $index_name, $fields ) = each %$indexes ) {
diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in
index d2b47fc..8a3cef7 100644
--- a/debian/templates/koha-conf-site.xml.in
+++ b/debian/templates/koha-conf-site.xml.in
@@ -342,7 +342,7 @@ __END_SRU_PUBLICSERVER__
       by visiting /cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1&reset_fields=1.
       Resetting mappings will override any changes made in the Search engine configuration UI.
  -->
- <!-- <elasticsearch_index_mappings>__KOHA_CONF_DIR__/searchengine/elasticsearch/mappings.yaml</elasticsearch_index_mappings> -->
+ <!-- <elasticsearch_index_mappings>/usr/share/koha/intranet/cgi-bin/admin/searchengine/elasticsearch/mappings.yaml</elasticsearch_index_mappings> -->
 
  <interlibrary_loans>
      <!-- Path to where Illbackends are located on the system
diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml
index 5416065..88431c7 100644
--- a/etc/koha-conf.xml
+++ b/etc/koha-conf.xml
@@ -173,7 +173,7 @@ __PAZPAR2_TOGGLE_XML_POST__
       by visiting /cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1&reset_fields=1.
       Resetting mappings will override any changes made in the Search engine configuration UI.
  -->
- <!-- <elasticsearch_index_mappings>__KOHA_CONF_DIR__/searchengine/elasticsearch/mappings.yaml</elasticsearch_index_mappings> -->
+ <!-- <elasticsearch_index_mappings>__INTRANET_CGI_DIR__/admin/searchengine/elasticsearch/mappings.yaml</elasticsearch_index_mappings> -->
 
  <interlibrary_loans>
      <!-- Path to where Illbackends are located on the system
-- 
2.1.4