Browse Source

Bug 25172: Identify and display possible problems on the about page

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Jonathan Druart 3 years ago
committed by Martin Renvoize
parent
commit
7283a3a3e7
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 20
      about.pl
  2. 15
      koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

20
about.pl

@ -25,6 +25,7 @@ use Modern::Perl;
use CGI qw ( -utf8 );
use DateTime::TimeZone;
use File::Spec;
use File::Slurp;
use List::MoreUtils qw/ any /;
use LWP::Simple;
use Module::Load::Conditional qw(can_load);
@ -48,6 +49,7 @@ use Koha::Caches;
use Koha::Config::SysPrefs;
use Koha::Illrequest::Config;
use Koha::SearchEngine::Elasticsearch;
use Koha::Logger;
use C4::Members::Statistics;
@ -93,6 +95,24 @@ my $time_zone = {
environment_invalid => $env_invalid
};
{ # Logger checks
my $log4perl_config = C4::Context->config("log4perl_conf");
my @log4perl_errors;
if ( ! $log4perl_config ) {
push @log4perl_errors, 'missing_config_entry'
}
else {
my @lines = read_file($log4perl_config) or push @log4perl_errors, 'cannot_read_config_file';
for my $line ( @lines ) {
next unless $line =~ m|log4perl.appender.\w+.filename=(.*)|;
push @log4perl_errors, 'logfile_not_writable' unless -w $1;
}
}
eval {Koha::Logger->get};
push @log4perl_errors, 'cannot_init_module' and warn $@ if $@;
$template->param( log4perl_errors => @log4perl_errors );
}
$template->param(
time_zone => $time_zone,
current_date_and_time => output_pref({ dt => dt_from_string(), dateformat => 'iso' })

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

@ -184,7 +184,7 @@
</div>
<div id="sysinfo">
[% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships %]
[% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors %]
[% IF (warnIsRootUser) %]
<h2>Warning regarding current user</h2>
<p>You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.</p>
@ -246,6 +246,19 @@
[% END %]
[% END %]
[% IF log4perl_errors %]
<h2>Logging system does not behave correctly</h2>
[% FOR e IN log4perl_errors %]
[% SWITCH e %]
[% CASE 'missing_config_entry' %]There is no 'log4perl_conf' entry in the config file.
[% CASE 'cannot_read_config_file' %]The log4perl config file cannot be opened.
[% CASE 'logfile_not_writable' %]One of the logfiles listed in the config file is not writable.
[% CASE 'cannot_init_module' %]The Koha::Logger module cannot be initiated correctly (check the log file).
[% CASE %]Unknown error "[% e %]"
[% END %]
[% END %]
[% END %]
[% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules %]
<h2>Warnings regarding the system configuration</h2>
<table>

Loading…
Cancel
Save