From a889f1e7d61cdd4a6e4bf2a12d59ff4dae7a1603 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 22 Jan 2014 11:27:07 -0300 Subject: [PATCH] Bug 11596: report warnings on the about patch if indexing options in koha-conf.xml are missing To test: - Have a clean master install - Verify that koha-conf.xml contains valid entries for: zebra_bib_index_mode and zebra_auth_index_mode - Go to More > About Koha > System information => No "Warnings regarding the system configuration" - Apply the patch - Go to More > About Koha > System information => No "Warnings regarding the system configuration" - Edit your koha-conf.xml file commenting one or both indexing mode entries. - Go to More > About Koha > System information => You get "XML configuration file" warnings for each commented entry. Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Mark Tompsett Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- about.pl | 14 ++++++++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 11 +++++++++++ 2 files changed, 25 insertions(+), 0 deletions(-) diff --git a/about.pl b/about.pl index ba77ca6..4687a45 100755 --- a/about.pl +++ b/about.pl @@ -78,6 +78,19 @@ my $errZebraConnection = C4::Context->Zconn("biblioserver",0)->errcode(); my $warnIsRootUser = (! $loggedinuser); my $warnNoActiveCurrency = (! defined C4::Budgets->GetCurrency()); +my @xml_config_warnings; + +if ( ! defined C4::Context->config('zebra_bib_index_mode') ) { + push @xml_config_warnings, { + error => 'zebra_bib_index_mode_warn' + }; +} + +if ( ! defined C4::Context->config('zebra_auth_index_mode') ) { + push @xml_config_warnings, { + error => 'zebra_auth_index_mode_warn' + }; +} $template->param( kohaVersion => $kohaVersion, @@ -96,6 +109,7 @@ $template->param( errZebraConnection => $errZebraConnection, warnIsRootUser => $warnIsRootUser, warnNoActiveCurrency => $warnNoActiveCurrency, + xml_config_warnings => \@xml_config_warnings, ); my @components = (); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 90f92bb..1477b02 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -120,6 +120,17 @@ Warning No active currency is defined. Please go to Administration > Currencies and exchange rates and mark one currency as active. [% END %] + [% ELSIF xml_config_warnings.size %] + + + [% FOREACH config_entry IN xml_config_warnings %] + [% IF config_entry.error == 'zebra_bib_index_mode_warn' %] + + [% ELSIF config_entry.error == 'zebra_auth_index_mode_warn' %] + + [% END %] + [% END %] +
XML configuration file
Warning The <zebra_bib_index_mode> entry is missing in your configuration file. It should be set to dom or grs1. It will default to grs1 but this could change in the future.
Warning The <zebra_auth_index_mode> entry is missing in your configuration file. It should be set to dom or grs1. It will default to dom but this could change in the future.
[% ELSE %]

No warnings

[% END %] -- 1.7.2.5