To minimize support questions regarding common mistakes, the About
page should have an additional tab that displays warnings if depractated
and/or mutual excluding system preferences are used.
To test patch use values as displayed on screenshot attached.
New: Shows error message in Tab Server Information if Zebra server is not started
(...and changes added...)
Suggestions for other values to add are welcome.
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
$apacheVersion = (`/usr/sbin/apache2 -V`)[0] unless $apacheVersion;
my $zebraVersion = `zebraidx -V`;
$apacheVersion = (`/usr/sbin/apache2 -V`)[0] unless $apacheVersion;
my $zebraVersion = `zebraidx -V`;
+# Additional system information for warnings
+my $prefNoZebra = C4::Context->preference('nozebra');
+my $prefAutoCreateAuthorities = C4::Context->preference('AutoCreateAuthorities');
+my $prefBiblioAddsAuthorities = C4::Context->preference('BiblioAddsAuthorities');
+my $warnPrefBiblioAddsAuthorities = ( $prefAutoCreateAuthorities && ( !$prefBiblioAddsAuthorities) );
+
+my $prefEasyAnalyticalRecords = C4::Context->preference('EasyAnalyticalRecords');
+my $prefUseControlNumber = C4::Context->preference('UseControlNumber');
+my $warnPrefEasyAnalyticalRecords = ( $prefEasyAnalyticalRecords && $prefUseControlNumber );
+
+my $errZebraConnection = C4::Context->Zconn("biblioserver",0)->errcode();
+
$template->param(
kohaVersion => $kohaVersion,
osVersion => $osVersion,
$template->param(
kohaVersion => $kohaVersion,
osVersion => $osVersion,
mysqlVersion => $mysqlVersion,
apacheVersion => $apacheVersion,
zebraVersion => $zebraVersion,
mysqlVersion => $mysqlVersion,
apacheVersion => $apacheVersion,
zebraVersion => $zebraVersion,
+ prefNoZebra => $prefNoZebra,
+ prefBiblioAddsAuthorities => $prefBiblioAddsAuthorities,
+ prefAutoCreateAuthorities => $prefAutoCreateAuthorities,
+ warnPrefBiblioAddsAuthorities => $warnPrefBiblioAddsAuthorities,
+ warnPrefEasyAnalyticalRecords => $warnPrefEasyAnalyticalRecords,
+ errZebraConnection => $errZebraConnection,
<ul>
<li><a href="#about">Server Information</a></li>
<li><a href="#perl">Perl modules</a></li>
<ul>
<li><a href="#about">Server Information</a></li>
<li><a href="#perl">Perl modules</a></li>
+ <li><a href="#sysinfo">System information</a></li>
<li><a href="#team">Koha Team</a></li>
<li><a href="#licenses">Licenses</a></li>
<li><a href="#translations">Translations</a></li>
<li><a href="#team">Koha Team</a></li>
<li><a href="#licenses">Licenses</a></li>
<li><a href="#translations">Translations</a></li>
<tr><th scope="row">MySQL version: </th><td>[% mysqlVersion |html %]</td></tr>
<tr><th scope="row">Apache version: </th><td>[% apacheVersion |html %]</td></tr>
<tr><th scope="row">Zebra version: </th><td>[% zebraVersion |html %]</td></tr>
<tr><th scope="row">MySQL version: </th><td>[% mysqlVersion |html %]</td></tr>
<tr><th scope="row">Apache version: </th><td>[% apacheVersion |html %]</td></tr>
<tr><th scope="row">Zebra version: </th><td>[% zebraVersion |html %]</td></tr>
+ [% IF (errZebraConnection == 10000) %]
+ <tr><th scope="row"><b>Error</b> </th><td>Zebra server seems not to be available. Is it started?</td></tr>
+ [% ELSIF (errZebraConnection) %]
+ <tr><th scope="row"><b>Warning</b> </th><td>Error message from Zebra: [% ( errZebraConnection ) %] </td></tr>
+ [% END %]
</table>
</div>
<div id="perl">
</table>
</div>
<div id="perl">
[% END %]
</table>
</div>
[% END %]
</table>
</div>
+
+ <div id="sysinfo">
+ <h2>Warnings regarding the system configuration</h2>
+ [% IF ( (prefNoZebra) || (warnPrefBiblioAddsAuthorities) || warnPrefEasyAnalyticalRecords ) %]
+ <table>
+ <caption>Preferences</caption>
+ [% IF (prefNoZebra) %]
+ <tr><th scope="row"><b>Warning</b> </th><td>System preference 'nozebra' set. Deprectated!</td></tr>
+ [% END %]
+ [% IF (warnPrefBiblioAddsAuthorities) %]
+ <tr><th scope="row"><b>Warning</b> </th><td>System preference 'AutoCreateAuthorities' set, but needs 'BiblioAddsAuthorities' set as well.</td></tr>
+ [% END %]
+ [% IF (warnPrefEasyAnalyticalRecords) %]
+ <tr><th scope="row"><b>Warning</b> </th><td>System preference 'EasyAnalyticalRecords' set, but UseControlNumber preference is set to 'Use'. Set it to 'Don't use' or else the 'Show analytics' links in the staff client and the OPAC will be broken.</td></tr>
+ [% END %]
+ </table>
+ [% ELSE %]
+ <p>No warnings</p>
+ [% END %]
+ </div>
+
<div id="team">
<h2>Special thanks to the following organizations</h2>
<ul>
<div id="team">
<h2>Special thanks to the following organizations</h2>
<ul>