From d792225e91585386e821f933b04e6a1836557ade Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 3 Feb 2023 15:18:13 -0300 Subject: [PATCH] Bug 14251: Add warning in about.pl for missing weasyprint To test: 1. Have weasyprint installed 2. Go to the About > System information page => SUCCESS: No warning about weasyprint 3. Uninstall weasyprint 4. Repeat 2 => SUCCESS: A warning is displayed and makes sense 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: David Nind Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- about.pl | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/about.pl b/about.pl index 1296996041..799cc51bc1 100755 --- a/about.pl +++ b/about.pl @@ -25,6 +25,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use DateTime::TimeZone; use File::Slurp qw( read_file ); +use IPC::Cmd qw(can_run); use List::MoreUtils qw( any ); use Module::Load::Conditional qw( can_load ); use Config qw( %Config ); @@ -324,6 +325,9 @@ if ( C4::Context->preference('ILLModule') ) { $template->param( warnILLConfiguration => $warnILLConfiguration ); } +unless ( can_run('weasyprint') ) { + $template->param( weasyprint_missing => 1 ); +} { # XSLT sysprefs diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 280b756680..7799f7c7ee 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -267,7 +267,7 @@ [% SET warnMissingCompiledFiles = 1 %] [% END %] [% WRAPPER tab_panel tabname= "sysinfo" %] - [% IF warnPrefRequireChoosingExistingAuthority || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnPrefOpacHiddenItems || invalid_yesno.count || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnConnectBroker || elasticsearch_has_missing || warnMissingCompiledFiles%] + [% IF weasyprint_missing || warnPrefRequireChoosingExistingAuthority || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnPrefOpacHiddenItems || invalid_yesno.count || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnConnectBroker || elasticsearch_has_missing || warnMissingCompiledFiles%] [% IF (warnIsRootUser) %]

Warning regarding current user

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.

@@ -382,7 +382,7 @@ Contact your system administrator. [% END # /IF warnConnectBroker %] - [% IF warnPrefRequireChoosingExistingAuthority || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnPrefOpacHiddenItems || invalid_yesno.count || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || warnXSLT || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnFastCataloging %] + [% IF weasyprint_missing || warnPrefRequireChoosingExistingAuthority || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnPrefOpacHiddenItems || invalid_yesno.count || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || warnXSLT || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnFastCataloging %]

Warnings regarding the system configuration

@@ -526,6 +526,12 @@ [% END %] [% END %] + [% IF weasyprint_missing %] + + [% END %] + [% IF oauth2_missing_deps %] -- 2.39.5
Preferences and parameters
Warning + The weasyprint tool is not installed. +
Warning