From 6a68ac3e5ded2e56d9b9de8f6e1a6a9ed49ac327 Mon Sep 17 00:00:00 2001 From: Mirko Tietgen Date: Sun, 7 Dec 2014 18:39:51 +0100 Subject: [PATCH] Bug 13404 - More System information about GRS1 vs DOM settings System information indicates missing and entries in koha-conf.xml. This patch - adds warnings about a possible mismatch between these settings and the actual setup - adds info about the actual setup/what values to use for and if they are not set. The assumption is that a path including 'zebra-*-dom.cfg' in the respective section indicates a DOM setup. Signed-off-by: Chris Cormack Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- about.pl | 46 +++++++++++++++++++ .../intranet-tmpl/prog/en/modules/about.tt | 42 +++++++++++++++++ 2 files changed, 88 insertions(+) diff --git a/about.pl b/about.pl index 9fd15455d4..3ac9c11414 100755 --- a/about.pl +++ b/about.pl @@ -80,24 +80,70 @@ my $warnIsRootUser = (! $loggedinuser); my $warnNoActiveCurrency = (! defined C4::Budgets->GetCurrency()); my @xml_config_warnings; +my $context = new C4::Context; + if ( ! defined C4::Context->config('zebra_bib_index_mode') ) { push @xml_config_warnings, { error => 'zebra_bib_index_mode_warn' }; + if ($context->{'server'}->{'biblioserver'}->{'config'} !=~ /zebra-biblios-dom.cfg/) { + push @xml_config_warnings, { + error => 'zebra_bib_mode_seems_grs1' + }; + } + else { + push @xml_config_warnings, { + error => 'zebra_bib_mode_seems_dom' + }; + } } else { push @xml_config_warnings, { error => 'zebra_bib_grs_warn' } if C4::Context->config('zebra_bib_index_mode') eq 'grs1'; } +if ( (C4::Context->config('zebra_bib_index_mode') eq 'dom') && ($context->{'server'}->{'biblioserver'}->{'config'} !=~ /zebra-biblios-dom.cfg/) ) { + push @xml_config_warnings, { + error => 'zebra_bib_index_mode_mismatch_warn' + }; +} + +if ( (C4::Context->config('zebra_auth_index_mode') eq 'grs1') && ($context->{'server'}->{'biblioserver'}->{'config'} =~ /zebra-biblios-dom.cfg/) ) { + push @xml_config_warnings, { + error => 'zebra_bib_index_mode_mismatch_warn' + }; +} + if ( ! defined C4::Context->config('zebra_auth_index_mode') ) { push @xml_config_warnings, { error => 'zebra_auth_index_mode_warn' }; + if ($context->{'server'}->{'authorityserver'}->{'config'} !=~ /zebra-authorities-dom.cfg/) { + push @xml_config_warnings, { + error => 'zebra_auth_mode_seems_grs1' + }; + } + else { + push @xml_config_warnings, { + error => 'zebra_auth_mode_seems_dom' + }; + } } else { push @xml_config_warnings, { error => 'zebra_auth_grs_warn' } if C4::Context->config('zebra_auth_index_mode') eq 'grs1'; } +if ( (C4::Context->config('zebra_auth_index_mode') eq 'dom') && ($context->{'server'}->{'authorityserver'}->{'config'} !=~ /zebra-authorities-dom.cfg/) ) { + push @xml_config_warnings, { + error => 'zebra_auth_index_mode_mismatch_warn' + }; +} + +if ( (C4::Context->config('zebra_auth_index_mode') eq 'grs1') && ($context->{'server'}->{'authorityserver'}->{'config'} =~ /zebra-authorities-dom.cfg/) ) { + push @xml_config_warnings, { + error => 'zebra_auth_index_mode_mismatch_warn' + }; +} + # Test QueryParser configuration sanity if ( C4::Context->preference( 'UseQueryParser' ) ) { # Get the QueryParser configuration file name diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 340d808ca0..e94316ee05 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -152,6 +152,20 @@ It will default to dom. + [% ELSIF config_entry.error == 'zebra_bib_mode_seems_grs1' %] + + Info + Your configuration file indicates that grs1 is the correct setting + for <zebra_bib_index_mode>. + + + [% ELSIF config_entry.error == 'zebra_bib_mode_seems_dom' %] + + Info + Your configuration file indicates that dom is the correct setting + for <zebra_bib_index_mode>. + + [% ELSIF config_entry.error == 'zebra_auth_index_mode_warn' %] Warning @@ -160,6 +174,20 @@ It will default to dom. + [% ELSIF config_entry.error == 'zebra_auth_mode_seems_grs1' %] + + Info + Your configuration file indicates that grs1 is the correct setting + for <zebra_auth_index_mode>. + + + [% ELSIF config_entry.error == 'zebra_auth_mode_seems_dom' %] + + Info + Your configuration file indicates that dom is the correct setting + for <zebra_auth_index_mode>. + + [% ELSIF config_entry.error == 'zebra_bib_grs_warn' %] Warning @@ -169,6 +197,13 @@ dom (full reindex required). + [% ELSIF config_entry.error == 'zebra_bib_index_mode_mismatch_warn' %] + + Warning + The <zebra_bib_index_mode> entry is set to dom, but your system appears to be set up for grs1 indexing. + It is safe to ignore this warning if biblio search is working. + + [% ELSIF config_entry.error == 'zebra_auth_grs_warn' %] Warning @@ -178,6 +213,13 @@ dom (full reindex required). + [% ELSIF config_entry.error == 'zebra_auth_index_mode_mismatch_warn' %] + + Warning + The <zebra_auth_index_mode> entry is set to dom, but your system appears to be set up for grs1 indexing. + It is safe to ignore this warning if authority search is working. + + [% ELSIF config_entry.error == 'queryparser_entry_missing' %] Warning -- 2.39.5