Bug 11596: report warnings on the about patch if indexing options in koha-conf.xml...
authorTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 22 Jan 2014 14:27:07 +0000 (11:27 -0300)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 20 Apr 2014 17:07:04 +0000 (17:07 +0000)
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>

about.pl
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

index ba77ca6..4687a45 100755 (executable)
--- 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 = ();
index 90f92bb..1477b02 100644 (file)
                 <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 %]