From 808bc4c370bda34852b0f89b871b1b6d2a0b8871 Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 18 Jan 2023 03:20:29 +0000 Subject: [PATCH] Bug 28267: Add warning on about.pl for database row formats This patch adds a warning on about.pl regarding database row formats other than "DYNAMIC". It points to the Koha community wiki for more information on how to resolve the problem. Test plan: 0. Apply the patch 1a. koha-mysql kohadev 1b. ALTER TABLE tags ROW_FORMAT=COMPACT; 2. Go to http://localhost:8081/cgi-bin/koha/about.pl 3. Note that there is a warning about database row formats 4a. koha-mysql kohadev 4b. ALTER TABLE tags ROW_FORMAT=DYNAMIC; 5. Go to http://localhost:8081/cgi-bin/koha/about.pl 6. Note that there is no warning about database row formats Note: Due to bug 32665 you'll see an unrelated warning on step 3 --- about.pl | 22 +++++++++++++++++++ .../intranet-tmpl/prog/en/modules/about.tt | 10 ++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/about.pl b/about.pl index f4d1c7a959..2719ab076c 100755 --- a/about.pl +++ b/about.pl @@ -621,6 +621,28 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; } } +#BZ 28267: Warn administrators if there are database rows with a format other than 'DYNAMIC' +{ + my $database = C4::Context->config('database'); + if ($database){ + my $dbh = C4::Context->dbh; + my $sql = q# + SELECT count(table_name) + FROM information_schema.tables + WHERE + table_schema = ? + AND row_format != "Dynamic" + #; + my $sth = $dbh->prepare($sql); + $sth->execute($database); + my $row = $sth->fetchrow_arrayref; + my $count = $row->[0]; + if ($count){ + $template->param( warnDbRowFormat => $count ); + } + } +} + my %versions = C4::Context::get_versions(); $template->param( diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 5b7834a434..54e68b5b87 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -219,7 +219,15 @@
- [% IF warnRequireChoosingExistingAuthority || 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 %] + [% IF warnRequireChoosingExistingAuthority || 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 || warnDbRowFormat %] + [% IF ( warnDbRowFormat ) %] +

Database row format incorrect

+

There are [% warnDbRowFormat %] database tables with a row format other than 'DYNAMIC'. You may experience problems upgrading to newer versions of Koha unless you update the row format for your database tables.

+

To know how to avoid this problem see the related wiki page: + Database row format +

+ [% END %] + [% 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.

-- 2.30.2