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 <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Tomas Cohen Arazi 2014-01-22 11:27:07 -03:00 committed by Galen Charlton
parent eb139e4a8b
commit a889f1e7d6
2 changed files with 25 additions and 0 deletions

View File

@ -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 = ();

View File

@ -120,6 +120,17 @@
<tr><th scope="row"><b>Warning</b> </th><td>No active currency is defined. Please go to <a href="/cgi-bin/koha/admin/currency.pl">Administration &gt; Currencies and exchange rates</a> and mark one currency as active.</td></tr>
[% END %]
</table>
[% ELSIF xml_config_warnings.size %]
<table>
<caption>XML configuration file</caption>
[% FOREACH config_entry IN xml_config_warnings %]
[% IF config_entry.error == 'zebra_bib_index_mode_warn' %]
<tr><th scope="row"><b>Warning</b> </th><td>The &lt;zebra_bib_index_mode&gt; entry is missing in your configuration file. It should be set to <strong>dom</strong> or <strong>grs1</strong>. It will default to <strong>grs1</strong> but this could change in the future.</td></tr>
[% ELSIF config_entry.error == 'zebra_auth_index_mode_warn' %]
<tr><th scope="row"><b>Warning</b> </th><td>The &lt;zebra_auth_index_mode&gt; entry is missing in your configuration file. It should be set to <strong>dom</strong> or <strong>grs1</strong>. It will default to <strong>dom</strong> but this could change in the future.</td></tr>
[% END %]
[% END %]
</table>
[% ELSE %]
<p>No warnings</p>
[% END %]